[SERVER-11097] Possible unanticipated conversion to regex Created: 09/Oct/13 Updated: 09/Jul/16 Resolved: 21/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.4.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kerem Kat | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Amazon mongo ubuntu package |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
Mongo client throws the following error upon issueing a find command that contains the string /^10/s in xxxID field in at least one document. Error: 16863 Error converting /^10/s in field xxxID to a JS RegExp object: SyntaxError: Invalid flags supplied to RegExp constructor 's' |
| Comments |
| Comment by Kerem Kat [ 21/Oct/13 ] | ||||
|
Hi Dan, This error is thrown even when the query is just
One of the document fields contains the expression
| ||||
| Comment by Daniel Pasette (Inactive) [ 21/Oct/13 ] | ||||
|
Hi Karem, this is a bug in the documentation, and I've opened a ticket for it. Javascript only supports the 'g', 'i', and 'm' option natively. In order to use the options "s" and "x" from javascript, you need to use the following form:
|