Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20067

Shell should decide whether or not to use find/getMore commands based on on wire protocol version

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.9
    • Component/s: Querying, Shell
    • Labels:
      None

      Description

      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:

      1. 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.
      2. legacy: Forces the shell to use legacy OP_QUERY/OP_GET_MORE reads regardless of the wire protocol version.
      3. 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");
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: