Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2330

order of keys is matters in hashes, in find, similar object gives different results on different queries.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.6.5
    • Querying
    • None
    • Ubuntu 10 server 64bit
    • ALL

    Description

      I cant expect programmers to remember the order in all places in the code especially in large code base.

      db.eventstatus.insert(
      {
      "_id": ObjectId("4d2093d0aaed39b6d9716b1d"),
      "t12_status": [

      { "status": "coming", "invite": ObjectId("4d208cdb50e82e8f65000002"), "value": 1 }

      ]
      });

      db.eventstatus.insert({
      "_id": ObjectId("4d208dac50e82e8f6500000b"),
      "t12_status": [

      { "invite": ObjectId("4d208cdb50e82e8f65000002"), "status": "coming", "value": 1 }

      ]
      });

      db.eventstatus.find({"t12_status":{"status":"coming","invite":ObjectId("4d208cdb50e82e8f65000002"),"value":1}});
      db.eventstatus.find({"t12_status":{"invite":ObjectId("4d208cdb50e82e8f65000002"),"status":"coming","value":1}});

      //expected: both queries will return the 2 documents. - wanted
      //actual@v1.6.5: each query returns a different object, one object. - not wanted, unexpected

      Attachments

        Activity

          People

            Unassigned Unassigned
            shimondoodkin Shimon Doodkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: