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

Wire protocol documentation should note that OP_GET_MORE's numberToReturn must be non-negative

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual, Server
    • None

    Description

      The wire protocol documentation for OP_GET_MORE (https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#wire-op-get-more) says the following about numberToReturn:

      Limits the number of documents in the first OP_REPLY message to the query. However, the database will still establish a cursor and return the cursorID to the client if there are more results than numberToReturn. If the client driver offers ‘limit’ functionality (like the SQL LIMIT keyword), then it is up to the client driver to ensure that no more than the specified number of document are returned to the calling application. If numberToReturn is 0, the db will used the default return size.

      This should be extended to mention that numberToReturn should be non-negative. In version 3.3.1, under SERVER-20808, we added validation which will cause the server to return an error if it receives an OP_GET_MORE with a negative numberToReturn. Previous versions of the server did not implement valid semantics for negative numberToReturn, but also failed to reject it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 14 weeks, 2 days ago