[COMPASS-2993] RegEx expressions not working in Compass 1.14.6 Created: 13/Jul/18 Updated: 27/Oct/23 Resolved: 14/Nov/18 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Compass |
| Affects Version/s: | 1.14.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Manish Singh | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Hello Team,
If you write a regex in Compass, it gives an error. The same works fine in the shell.
Regards, Manish Singh |
| Comments |
| Comment by Vegar Vikan [ 26/Feb/20 ] | |||||
|
OK - I got something to work... When searching for a digit, `[0..9]` works while `\d` does not.. | |||||
| Comment by Vegar Vikan [ 26/Feb/20 ] | |||||
|
How can this be 'Works as designed'? I can't get any regex syntax to work at all in aggregation pipelines. | |||||
| Comment by Blake Jarsky [ 10/Feb/20 ] | |||||
|
I get the same error | |||||
| Comment by Massimiliano Marcon [ 14/Nov/18 ] | |||||
|
MongoDB supports 3 syntaxes for regular expression matching:
In Compass we currently only support the second one. Your query could be therefore re-written as:
To be safe, you can always use JavaScript's RegExp('regex', 'options'). |