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

Positional operator in projection shouldn't match embedded document (only array)

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.1.2, 2.6.3
    • Component/s: Querying
    • ALL
    • Query 2019-11-04, Query 2019-11-18

      The following projection operation should likely throw a user assertion (or return nothing) due to matching an embedded object instead of the intended array:

      > db.a.save( { a:{b:1} } )
      > db.a.find( { a:{b:1} }, { 'a.$':1 } )
      { "_id" : ObjectId("4fe0f094026e93e0aaef076d"), "a" : { } }
      

            Assignee:
            ian.boros@mongodb.com Ian Boros
            Reporter:
            benjamin.becker Ben Becker
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: