-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
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.
- documents
-
SERVER-20808 Server should reject negative ntoreturn received with OP_GET_MORE message
- Closed
- is related to
-
JAVA-2231 Legacy driver sends nToReturn of -1 for OP_GET_MORE for an aggregation with batch size of 1
- Closed
- related to
-
DOCS-7296 Missing OpCodes in Wire Protocol Documentation
- Closed