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

$or in $elemMatch works inconsistently on master

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.6.0-rc0
    • 2.6.0-rc2
    • Querying
    • None
    • Fully Compatible
    • 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

              benety.goh@mongodb.com Benety Goh
              glasser David Glasser
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: