|
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.
|