-
Type: Investigation
-
Resolution: Works as Designed
-
Priority: Major - P3
-
Affects Version/s: 1.10.2
-
Component/s: None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
Not Needed
Problem Statement/Rationale
Customer's comment:
We have a critical issue for some important and complex queries after migration from mongo to mongosh (1.8.2 or 1.9.1).
RangeError: Value undefined out of range for undefined options property undefined
at Map.set (<anonymous>)
at AsyncHook.init (node:domain:79:15)
at emitInitNative (node:internal/async_hooks:202:43)
at emitInitScript (node:internal/async_hooks:505:3)
at promiseInitHook (node:internal/async_hooks:324:3)
at promiseInitHookWithDestroyTracking (node:internal/async_hooks:328:3)
at C:\dev\magellan-queries\queries\someQuery.js:24:14713
Steps to Reproduce
Customer gave us this code snippet (I was able to reproduce the error locally):
const superSet = new Set(); for (let i = 0; i <= 16777216; i++) superSet.add(i);
Not clear why this happens in mongosh and not in the old shell, mongo.
I understand that this error comes from V8, indeed, running the previous code snippet:
$ d8 execute-query.js
execute-query.js:2: RangeError: Set maximum size exceeded
for (let i = 0; i <= 16777216; i++) superSet.add(i);
^
RangeError: Set maximum size exceeded
at Set.add (<anonymous>)
at execute-query.js:2:46
Expected Results
No change to existing scripts behaviour
Actual Results
Customer's script errors out.
This is the Salesforce case number: 01166506