1
The only way I could get past this issue without making changes in the mongodb-engine
was to get the count using the normal queryset
. So to get the count I used
count = Model.objects.all().count()
and for the data I that wanted, I used
values = Model.objects.values('a', 'b')
- [Answer]-Django OneToMany relationship?
- [Answer]-Python — How to get Oldest date from a QuerySet?
- [Answer]-Query filter based on GenericForeignKey's fields
0
Try this:
query_list = list(query_set)
len = query_list.indexof(query_list[-1])
This method is nothing similar to len
function of list. As you might know len
uses loop to calculate the length but above method exploits hashing.
- [Answer]-How to get an associated model via a custom admin action in Django?
- [Answer]-When developing a Django reusable app, how to deploy to Heroku?
- [Answer]-Can you set a breakpoint and drop into interactive mode from command line in pycharm 3?
- [Answer]-Django Ajax search will not work
- [Answer]-Viewing images uploaded to Django Admin
0
Your issue caused because of mongodb aggregation functions.
you can use `Model.objects.item_frequencies(‘field’)
or you can read here.
- [Answer]-Passing a Query Set to a Template
- [Answer]-Sending arbitrary request data in Django
- [Answer]-Django: Could not import settings.py
- [Answer]-TemplateDoesNotExist but it exists
- [Answer]-Commenting app for all other apps in Django
Source:stackexchange.com