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

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Ryan Wynn
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: