Pattern Search Support in $filter & $cond operator

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Rahul Raj
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: