djongo icon indicating copy to clipboard operation
djongo copied to clipboard

Bug on LIMIT - OFFSET queries

Open deeptechs opened this issue 8 years ago • 4 comments

This type of queries are buggy.

Problem is so weird. I can explain it with images. It happened in my pagination part. Firs I tried to find the problem on template, but it is rising from djongo I guess. Here is the debug pictures of my 2 projects. While sqlite there is no problem with the queries, when using mongodb with djongo there are problems with queries. self.object_list is a django pagination object. There are 3 objects in both 2 examples.

First while using sqlite,

  1. There are completely 3 objects in sqlite db. 1_1

  2. When queries [2:3], it returns one object as we expected. 1_6

Second while using MongoDB with Djongo,

  1. There are completly 3 objects in MongoDb. 1

  2. When queries [2:3], it returns en empty query list. 6

No trace back info about it.

deeptechs avatar Apr 11 '18 12:04 deeptechs

Facing same issue :(

p = Profile.objects.filter(user__is_superuser=False) p.count() 16 p <QuerySet [<Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >]> p[0:10] <QuerySet [<Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >, <Profile: >]> p[10:12] <QuerySet []> p[8:12] <QuerySet []> Please let me know do you find any solution on this . Thanks

ganeshcmohan avatar Dec 16 '18 10:12 ganeshcmohan

Actually it was the poc for me then I didn't use djongo even mongo after this problem. Continued with the sqlite for poc.

deeptechs avatar Dec 16 '18 11:12 deeptechs

Oh thanks for the reply :) I am stuck with this issue in the 2nd phase of the project, cant rework on models :( . I am facing issue only when using filter with a foreignkey relation model field.

ganeshcmohan avatar Dec 16 '18 11:12 ganeshcmohan

This is fixed

nesdis avatar Jan 26 '19 14:01 nesdis