[SERVER-2270] Add an $and operator Created: 22/Dec/10  Updated: 22/Dec/10  Resolved: 22/Dec/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Christopher Maier Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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!



 Comments   
Comment by Eliot Horowitz (Inactive) [ 22/Dec/10 ]

See SERVER-1089

Generated at Thu Feb 08 02:59:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.