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.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 1.6.5
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Ubuntu 10 server 64bit
    • Operating System:
      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

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

              Dates

              Created:
              Updated:
              Resolved: