Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-841

FAQ entry for key order and subdocument equality matching

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0, 2.8.1
    • Affects Version/s: None
    • Component/s: Docs
    • None

      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.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            mba Marcin Barczy?ski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: