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

Pattern Search Support in $filter & $cond operator

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      Description

      Currently there's no way to use pattern match in $filter or $cond operators. Pattern match is most frequently used filtering/conditional methodologies
      It seems quite disappointing that there are restrictions on using conditions while the sole purpose of $filter & $cond are to filtering out result set. Sample query is given below. I'm not putting similar code on $cond since it looks same. It would be nice if we can do something like below:

      // Some comments here
      {
        $filter: {
           input: "$Restaurants",
           as: "restaurant",
           cond: { "$$restaurant":{$regex: "valley"} }
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kelsey.schubert Kelsey T Schubert
              Reporter:
              rahulraj Rahul Raj
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: