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

Add inclusion/exclusion operator for field values

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Querying
    • None

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: