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

$exists in find() gives error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • 2.6.0
    • Querying
    • None
    • ALL

    Description

      The following query can be executed successfully:

      mydb> db.testData.find({"y":{"$exists" : true}}, {"y" : null})

      But, swith the places of the criteria:

      mydb> db.testData.find({"y" : null},{"y":{"$exists" : true}})

      system gives the following error:

      error: {
              "$err" : "Can't canonicalize query: BadValue Unsupported projection opti
      on: y: { $exists: true }",
              "code" : 17287
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            Milton Xiong Xiong Sheng [X]
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: