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

Add an $and operator

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

      MongoDB has implicit "and"ing of conditions, but sometimes it would be nice to have an actual $and operator for times when you need to specify multiple conditions on a single field (for example, making sure an array contains an item that meets criteria X and another item that meets criteria Y.

      I [wrote this up](http://christophermaier.name/2010/12/21/mongodb-query-tricks.html) on my blog and detailed a workaround using $nor and $not, but it's kind of ugly and cumbersome to use in complicated queries. It would be nice if the query engine supported an actual $and operator to make things more clear for queries like these.

      Thanks!

            Assignee:
            Unassigned Unassigned
            Reporter:
            cwmaier Christopher Maier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: