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

$exists in find() gives error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.6.0
    • Component/s: Querying
    • Labels:
      None
    • ALL

      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
      }
      

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

              Created:
              Updated:
              Resolved: