The shell and drivers should detect based on wire version whether or not the server supports the find and getMore commands and then use the appropriate protocol for .find() operations.
The shell should support three values for the --readMode flag:
- compatibility: This is the default if no value is supplied for --readMode. This mode indicates that the shell should use the wire protocol version from the response to an isMaster command in order to determine which read protocol to use. If the server supports find/getMore commands, the shell should use "commands" readMode. Otherwise, the shell should degrade to legacy OP_QUERY/OP_GET_MORE reads.
- legacy: Forces the shell to use legacy OP_QUERY/OP_GET_MORE reads regardless of the wire protocol version.
- commands: Forces the shell to use find/getMore commands regardless of the wire protocol version.
You can also set the shell to use a particular readMode at runtime:
// Force the shell to use OP_QUERY/OP_GET_MORE reads. db.getMongo().forceReadMode("legacy"); // Force the shell to use find/getMore commands. db.getMongo().forceReadMode("commands");
- depends on
-
SERVER-20294 Race condition in shard targeting logic results in "Shard not found" error
- Closed
-
SERVER-20194 Enable new cursor manager path in mongos for legacy OP_QUERY/OP_GET_MORE/OP_KILLCURSORS query operations
- Closed
- is related to
-
DRIVERS-211 New commands for find, getMore, and killCursors
- Closed
-
SERVER-19572 Change shell default read mode to "compatibility"
- Closed