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

$or in $elemMatch works inconsistently on master

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc0
    • Fix Version/s: 2.6.0-rc2
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      On the 2014-01-02 nightly:

      > db.x.find({x: {$elemMatch: {y: 12, $or:[{z: 1}, {z: 2}]}}})
      > db.x.find({x: {$elemMatch: {$or:[{z: 1}, {z: 2}], y: 12}}})
      error: {
      	"$err" : "Can't canonicalize query: BadValue unknown operator: $or",
      	"code" : 17287
      }

      Both work in 2.4.9. I would expect that either both of these queries would work or both would fail.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              glasser David Glasser
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: