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

Pattern Search Support in $filter & $cond operator

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None

      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"} }
        }
      }
      

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

              Created:
              Updated:
              Resolved: