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

Shell incorrectly issues first query in legacy read mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.2.4, 3.3.2
    • Component/s: Shell
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Sprint:
      Query 10 (02/22/16)

      Description

      In a shell session with a server that supports read commands, the first query issued is executed with legacy OP_QUERY reads, but subsequent queries are executed with read commands. If the server supports read commands, all queries should be executed with read commands.

      See the following shell session:

      MongoDB shell version: 3.2.1
      connecting to: test
      > db.version()
      3.2.1
      > db.foo.find().sort([{a: 1}, {b: 1}])  // Executes with OP_QUERY legacy reads.
      { "_id" : ObjectId("56b0fbb44739a301b71f0e73") }
      { "_id" : ObjectId("56b0fd134739a301b71f0e78"), "a" : -1, "b" : 3 }
      { "_id" : ObjectId("56b0fd164739a301b71f0e79"), "a" : -1, "b" : 7 }
      { "_id" : ObjectId("56b0fd0c4739a301b71f0e74"), "a" : 1, "b" : 1 }
      { "_id" : ObjectId("56b0fd0f4739a301b71f0e76"), "a" : 1, "b" : 3 }
      { "_id" : ObjectId("56b0fd0e4739a301b71f0e75"), "a" : 1, "b" : 5 }
      { "_id" : ObjectId("56b0fd114739a301b71f0e77"), "a" : 2, "b" : 3 }
      > db.foo.find().sort([{a: 1}, {b: 1}])  // Executes with read commands.
      Error: error: {
      	"waitedMS" : NumberLong(0),
      	"ok" : 0,
      	"errmsg" : "Failed to parse: sort: [ { a: 1.0 }, { b: 1.0 } ]. 'sort' field must be of BSON type Object.",
      	"code" : 9
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: