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

Find and Aggregation Cursors always have a default batch size of 1000

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Problem

      Find and Aggregation Cursors created by the driver will always have a default batch size of 1000 applied to them without the possibility to just leave out a batch size setting.

      This causes a major performance overhead for scripts potentially run inside mongosh compared to the old shell. The old shell relied on the server's default behavior by not specifying any batch size by default. As such the server will return up to 101 results on the initial find() and subsequent getMore() calls will return up to 16MB of data.

      Current batching of at most 1000 entries by default requires a lot more network round trips to get the same amount of documents (depending on document size) but the incurred latency cost drastically increases runtime.

      Suggested Solution

      Do not apply a default batch size.

            Assignee:
            Unassigned Unassigned
            Reporter:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: