|
Public functions that create a cursor (like mongoc_collection_find_with_opts) have one way to specify options, through a bson_t opts.
There are multiple ways bson options are handled when a cursor is returned:
- driver specific options, like "serverId" never get sent to the server
- options specific to the initial command (e.g. "bypassDocumentValidation") apply to the initial command, but not to getMore
- options like "batchSize" apply to both the initial command and the getMore
- options like "maxAwaitTimeMS" may trigger "maxTimeMS" being set on the getMore
We've gotten this wrong before. See CDRIVER-3031. And I suspect there may be other cases we aren't handling quite right. Let's exhaustively audit functions that return a cursor and make it clear how we're handling options, and use the IDL where possible to have consistent behavior.
|