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

Allow the ability to return a subset of the elements in an array property

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      Given a websites collection with a document

      { _id: 0, domain: "mongodb.org", "like": [1, 2, 3, 4, 5] }

      where like represents the ids of all users who have "liked" the document,

      Allow a query such as:

      db.websites.find(

      { domain : "mongodb.org'' }

      , { like : {$in : [4, 5, 6] } } );

      resulting in

      { _id:0, domain: "mongodb.org", "like": [4, 5] }

      Currently, the only way to do this is to filter client side or store the data in a more normalized fashion.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ryan.m.wynn@gmail.com Ryan Wynn
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: