using $elemMatch projection with $all gives unexpected results

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2.0-rc0, 2.6.3
    • Component/s: Querying
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using $all, it results in x not appearing in the results

      for ( i = 0; i < 100; i++ ) {
          t.insert({ group: 1, x: [ 1, 2, 3, 4, 5 ] });
      }
      > t.find( { group:1 }, { _id : 0, x: { $elemMatch: { $all:[1, 2, 3] } } } ).limit(1)
      { }
      

      May be better to uassert instead.

              Assignee:
              Unassigned
              Reporter:
              Jeffrey Yemin
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: