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

$only for feature for fields that are embedded arrays

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.5.0
    • Component/s: Querying
    • Labels:
      None
    • Query

      Similar to the new slice functionality

      db.foo.find( {} , { likes: { $only: [user_1, user_2]} } ) and it would return the list of user_ids that were found

      My original idea was to recommend something like this, but mstearn recommended the one above instead.

      db.foo.find( {} , { likes: { $has: user_1 } } ) and it would use return True/False

      Because I just want the objects, and I want to know if the user liked each one without returning the full list of likes.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            stanislav Stanislav Vishnevskiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: