[COMPASS-3130] Regular expression literals can't handle backslashes in agg builder Created: 17/Sep/18 Updated: 29/Oct/23 Resolved: 24/Mar/20 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Aggregation pipeline, Grammar |
| Affects Version/s: | None |
| Fix Version/s: | 1.22.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anna Herlihy (Inactive) | Assignee: | Durran Jordan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Iteration Zebra | ||||||||
| Description |
|
You can't escape backslashes in a regex literal in the agg builder, but the same regex in the query bar and shell work fine. Example: /abc\/123/ will error in the agg builder but not the query. Workaround is to use the "RegExp" object with a string instead of a literal. |
| Comments |
| Comment by Brian Blevins [ 12/Jun/19 ] | |
|
The RegExp() workaround requires a double backslash in order to work properly in Compass 1.18.0.
|