As in django with sql backend we can convert a queryset into flat list by
foovar.objects.all().values_list('id', flat=true)
give a list of ids
How to get list of ids in mongo backend ,ORM being used is mongoengine in which values_list function has no flat parameter.