[SERVER-32470] Support for $regex operator in $filter of aggregation pipeline. Created: 28/Dec/17 Updated: 29/Jan/18 Resolved: 16/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Abhinandan Kothari | Assignee: | Asya Kamsky |
| Resolution: | Duplicate | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
Motivation: There should be support in aggregation pipeline for filtering an array using regex on a text field. Syntax Proposal :
Examples:
Pipeline :
Output : { _id: 1, filteredArray: [ "mongodb", "MongoDB", "MONGODB" ] } |
| Comments |
| Comment by Asya Kamsky [ 16/Jan/18 ] | ||
|
kothariabhi02 I suppose technically this ticket is a duplicate of The syntax that's proposed there is just that - a proposal, feel free to comment in that ticket if the proposed output will not satisfy your use case. Note that $filter allows you to use all aggregation expressions/operators inside cond so there shouldn't be a need to create a unique/different $regex expression for $filter. As a side note, the exact example you provided can be handled in current version using:
| ||
| Comment by Abhinandan Kothari [ 16/Jan/18 ] | ||
|
Any progress on it? | ||
| Comment by Abhinandan Kothari [ 01/Jan/18 ] | ||
|
Hi Asya Kamsky , | ||
| Comment by Asya Kamsky [ 29/Dec/17 ] | ||
|
This looks like a duplicate of | ||
| Comment by Kelsey Schubert [ 29/Dec/17 ] | ||
|
Hi kothariabhi02, Thank you for the feature request. I've sent it to the Query team for consideration, please continue to watch this ticket for updates. Kind regards, |