Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6169

6.6.0 driver broke `raw: true`

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.6.0
    • Component/s: None
    • 3
    • 0
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      import { MongoClient } from 'mongodb';
      
      const client = await MongoClient.connect('mongodb://localhost:27017/');
      const result = await client.db('test').collection('test').aggregate([], { raw: true }).toArray();
      console.log(result);
      await client.close();
      

      works fine in 6.5.0, throws in 6.6.0

      $ node test.mjs
      /private/tmp/node_modules/mongodb/lib/utils.js:573
              for (const value of iterable) {
                                  ^
      
      TypeError: iterable is not iterable
          at List.pushMany (/private/tmp/node_modules/mongodb/lib/utils.js:573:29)
          at [kInit] (/private/tmp/node_modules/mongodb/lib/cursor/abstract_cursor.js:483:34)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async next (/private/tmp/node_modules/mongodb/lib/cursor/abstract_cursor.js:520:13)
          at async AggregationCursor.next (/private/tmp/node_modules/mongodb/lib/cursor/abstract_cursor.js:237:16)
          at async [Symbol.asyncIterator] (/private/tmp/node_modules/mongodb/lib/cursor/abstract_cursor.js:162:34)
          at async AggregationCursor.toArray (/private/tmp/node_modules/mongodb/lib/cursor/abstract_cursor.js:280:26)
          at async file:///private/tmp/test.mjs:4:16
      
      Node.js v20.13.1
      

      Use Case

      As a... driver user
      I want... the driver to not throw exceptions in normal usage
      So that... I can update to the latest patch release of the driver

      User Impact

      No idea. This was caught by Compass's tests.

      Dependencies

      Can work around this on our side, so N/A.

      Unknowns

      • questions that need to be answered to determine implementation

      Acceptance Criteria

      Implementation Requirements

      • functional reqs, potential snafus to avoid, performance targets, etc

      Testing Requirements

      • unit test, spec test sync, etc

      Documentation Requirements

      • DOCSP ticket, API docs, etc

      Follow Up Requirements

      • additional tickets to file, required releases, etc

            Assignee:
            Unassigned Unassigned
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: