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

Inability to find a document in the collection, if the find-query containes the fields not in the same order as they are in the collection.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0.7
    • Component/s: Querying, Shell
    • Environment:
      Ubuntu 12.04 LTS 32 bit
    • Linux

      Example:
      > db.createCollection('testCol')

      { "ok" : 1 }

      > db.testCol.insert({fish: {name: 'Arctic fish', desciption: 'I like cold water!'}})

      And now we a going to find our recond.
      > db.testCol.find({fish: {name: 'Arctic fish', desciption: 'I like cold water!'}})
      { "_id" : ObjectId("503f37b12f2ef2c8d4b9a430"), "fish" :

      { "name" : "Arctic fish", "desciption" : "I like cold water!" }

      }

      But if we define fields in other order, mongo can't find our record.
      > db.testCol.find({fish:

      {desciption: 'I like cold water!', name: 'Arctic fish'}

      )

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexander bartash Alexander
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: