[SERVER-2044] Add inclusion/exclusion operator for field values Created: 01/Nov/10  Updated: 22/Mar/13  Resolved: 02/Nov/10

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

Type: Improvement Priority: Minor - P4
Reporter: Terry Greenlaw Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

For ease of use in auto-generating queries and supporting advanced pick lists, there should be a $filter or $restrict operator for field values that works like a combination of $in and $nin. It would function just like the fields array parameter to the find* methods.

In the PHP driver, it would look like:
$coll->find('fieldName' => array('$filter' => array('fieldValue1'=>1, 'fieldValue2'=>1)));
to work as an $in, and :
$coll->find('fieldName' => array('$filter' => array('fieldValue1'=>0, 'fieldValue2'=>0)));
to work as a $nin.

$in and $nin could then just become convenience operators, and the symmetry with the field selector reinforces the strength of the language. There are a couple of other language symmetry enhancements that I will log in different issues.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 02/Nov/10 ]

SERVER-828 is the solution we're looking into for this issue

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