I have a database collection (called fols), for example:
{'followers':
{
'123':1
'123':2
'123':3
}
}
If I run the query (using pymongo):
cursor = fols.find()
cursor.count()
>>3
It works great. Now:
cursor = fols.find({'followers':{'123':1}})
cursor.count()
>>1
Again works fine. BUT if I try:
cursor = fols.find({'followers':{'123':{'$exists': True}}})
cursor.count()
>> 0
It returns 0, although there are 3 records.
source
share