Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1549

After upgrading from the mongo cli to mongosh, customer scripts error out

    • Type: Icon: Investigation Investigation
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • 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 

            Assignee:
            Unassigned Unassigned
            Reporter:
            frederik.nosi@mongodb.com Frederik Nosi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: