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

Allow projection on array elements

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      It would be great if field specification could limit automatically array elements. So that you could do something like:

      ```
      db.foo.find({},

      {'bar.0'}

      )
      ```

      And get from:

      ```

      {bar: ['a', 'b', 'c']}

      ```

      This result:

      ```

      {bar: 'a'}

      ```

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: