$or in $elemMatch works inconsistently on master

XMLWordPrintableJSON

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

      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.

        1. server12981.js
          0.7 kB
          Benety Goh

              Assignee:
              Benety Goh
              Reporter:
              David Glasser
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: