Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
5
Description
Problem Description
While editing a view, I noticed that my query results change. I defined my view as :
{$addFields: {
|
returnObject: {
|
$regexFind: {
|
input: "$Job", regex: /\[(.*)\]/ }
|
}
|
}
|
But when I click "modify source" the view is now defined as:
[{$addFields: {
|
returnObject: {
|
$regexFind: {
|
input: '$Job',
|
regex: RegExp('\[(.*)\]')
|
}
|
}
|
}
|
This is creating a different capture in the $regexFind. This may be a server bug, but the re-writing of the query exposed this. Saving the query as a view does not cause the view definition to be re-written – it's only on modifying it. I raised SERVER-55583 to check on the syntax difference. You can see that report for raw repro.
Steps to Reproduce
Expected Results
Actual Results
Additional Notes
Attachments
Issue Links
- is related to
-
SERVER-55583 Difference between RegExp and raw // syntax for $regexFind captures
-
- Closed
-