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

FAQ entry for key order and subdocument equality matching

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.0, 2.8.1
    • Docs
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: