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

Commands wrapped in $query reports wrong error message for unrecognized commands

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.2
    • Affects Version/s: 2.3.1
    • Component/s: Sharding
    • None
    • ALL

      db.$cmd.find({ $query: { count: 'user' }}).limit(-1).next()
      

      works ok

      db.$cmd.find({ secretCommand: 1 }).limit(-1).next()
      

      gives you:

      { "$err" : "unrecognized command: secretCommand", "code" : 13390 }

      , which is expected.

      while:

      db.$cmd.find({ $query: { secretCommand: 1 }}).limit(-1).next()
      

      gives you:

      { "$err" : "unrecognized command: $query", "code" : 13390 }

      , which is wrong

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: