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

$or in $elemMatch works inconsistently on master

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL

      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.

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

              Created:
              Updated:
              Resolved: