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

Projections using dot notation to select an array element don't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL

      Description

       db.getCollection('SomeCollection').find({}, {'array.0':1}) 

      I would expect the above to return documents like:

       {array:[{a:'a',b:'b'}]} 

      but instead returns all elements of the array, just as empty objects:

       {array:[{}, {}, {}]} 

      This doesn't make any sense. It seem broken.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: