Here is example code that reproduces the problem:
import pymongo client = pymongo.MongoClient() client.drop_database('test_db') client['admin'].command({'setParameter': 1, 'notablescan': False}) db = client.test_db coll = db['coll'] res = coll.insert({'a': {'png': 0, 'jpg': 0}}) entries = list(coll.find()) print "All entries:", entries for e in entries: res = list(coll.find(e)) print "Single entry", res assert len(res) == 1 and res[0] == e client.drop_database('test_db')
Removing or renaming either 'png' or 'jpg' field helps. I am wondering why those names are special.