Using extended $options for $regex (i.e. "x" or "s") does not work with explain output. Instead, we get the following error:
Error: 16863 Error converting /a/msix in field 0 to a JS RegExp object: SyntaxError: Invalid flags supplied to RegExp constructor 'sx' at src/mongo/shell/types.js:612
It looks like there is an attempt at converting the $regex:... , $options:... format of a mongo regular expression into the javascript /.../ regular expression format when formatting the explain output, but the non-standard flags can't be appended to this.
- is duplicated by
-
SERVER-13086 Regex with "x" option explain fails with index on target field in 2.4
- Closed
- is related to
-
SERVER-21974 mongo shell can't explain insensible case regex
- Closed
-
DRIVERS-82 Don't compile BSON regexes to native regexes
- Closed
- related to
-
SERVER-14107 Querying for a document containing a value of either type Javascript or JavascriptWithScope crashes the shell
- Closed
-
SERVER-10448 Revamp explain() formatting
- Closed