Add inclusion/exclusion operator for field values

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Terry Greenlaw
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: