Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12744

[Server] Delete outdated statements on batchSize page

      Description

      The page on batchSize states "Do not use a batch size of 1." and "Specifying 1 or a negative number is analogous to using the limit() method."

      However, this is no longer true. Today, batchSize:1 behaves the same as any other positive batchSize.

      It does not imply a limit of 1:

      > db.c.find().batchSize(1).itcount()
      3
      

      And we can see that documents are returned 1 at a time:

      2019-05-22T15:45:12.777-0400 I  COMMAND  [conn1] command test.c appName: "MongoDB Shell" command: find { find: "c", filter: {}, batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } planSummary: COLLSCAN cursorid:7412042066655548514 keysExamined:0 docsExamined:1 numYields:0 nreturned:1 reslen:120 locks:{ ParallelBatchWriter: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } }, Mutex: { acquireCount: { r: 1 } } } protocol:op_msg 0ms
      2019-05-22T15:45:12.778-0400 I  COMMAND  [conn1] command test.c appName: "MongoDB Shell" command: getMore { getMore: 7412042066655548514, collection: "c", batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } originatingCommand: { find: "c", filter: {}, batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } planSummary: COLLSCAN cursorid:7412042066655548514 keysExamined:0 docsExamined:1 numYields:0 nreturned:1 reslen:119 locks:{ ParallelBatchWriter: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } }, Mutex: { acquireCount: { r: 1 } } } protocol:op_msg 0ms
      2019-05-22T15:45:12.778-0400 I  COMMAND  [conn1] command test.c appName: "MongoDB Shell" command: getMore { getMore: 7412042066655548514, collection: "c", batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } originatingCommand: { find: "c", filter: {}, batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } planSummary: COLLSCAN cursorid:7412042066655548514 keysExamined:0 docsExamined:1 numYields:0 nreturned:1 reslen:119 locks:{ ParallelBatchWriter: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } }, Mutex: { acquireCount: { r: 1 } } } protocol:op_msg 0ms
      2019-05-22T15:45:12.779-0400 I  COMMAND  [conn1] command test.c appName: "MongoDB Shell" command: getMore { getMore: 7412042066655548514, collection: "c", batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } originatingCommand: { find: "c", filter: {}, batchSize: 1.0, lsid: { id: UUID("e9d60651-adb1-44f8-8833-4e964306aa97") }, $db: "test" } planSummary: COLLSCAN cursorid:7412042066655548514 keysExamined:0 docsExamined:0 cursorExhausted:1 numYields:0 nreturned:0 reslen:94 locks:{ ParallelBatchWriter: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } }, Mutex: { acquireCount: { r: 1 } } } protocol:op_msg 0ms
      

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            alison.huh@mongodb.com Alison Huh
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 25 weeks, 1 day ago