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

$all with single element matches scalar

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL

      The documentation for $all says:

      The $all operator selects the documents where the value of a field is an array that contains all the specified elements. 

      However this does not match the following behavior on master:

      > coll.drop()
      > coll.insert({_id: 1, a: 1})
      > coll.find({a: {$all: [1]}})
      {_id: 1, a: 1 }

      If these are the intended semantics, we should update this ticket to request a docs update. If however, these semantics are unintentional, and $all should only match arrays (similar to $elemMatch), this ticket should fix the behavior.

            Assignee:
            kateryna.kamenieva@mongodb.com Katya Kamenieva
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: