-
Type: New Feature
-
Resolution: Duplicate
-
Priority: 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"} } } }
- duplicates
-
SERVER-11947 Add a regex expression to the aggregation language
- Closed