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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.9
    • Affects Version/s: None
    • Component/s: Querying, Shell
    • None
    • Fully Compatible
    • QuInt A (10/12/15)

      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");
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: