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.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.0.7
    • Querying, Shell
    • Ubuntu 12.04 LTS 32 bit
    • Linux

    Description

      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'}

      )

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: