MongoEngine slicing queryset (mongodb with django)

I have such a request in python.

notes = Note.objects[:10] 

If I do len (notes), it gives me 10, which is correct. But when I pass the "notes" object to the template and try

 {{notes|length}} 

then I get 16 (which is the total number of given notes). Even if I do Note.objects.limit(5) the same. Is this a bug in MongoEngine? or am i doing something wrong?

+1
django mongodb mongoengine
source share
1 answer

This was a bug in MongoEngine. You can find out about it; https://github.com/hmarr/mongoengine/issues/166

+1
source share

All Articles