Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-649

db.runCommand and db.adminCommand do not support string argument right now

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.10.0
    • Affects Version/s: 0.9.0
    • Component/s: Shell API
    • None
    • 1
    • Iteration Yucca
    • Not Needed

      mongosh currently does not support the "string" variants of db.runCommand and db.adminCommand - only the "object" style is supported.

      Example that works:

      db.runCommand( { isMaster: 1 } )
      

      Example that does not work but works in mongo:
      db.runCommand('isMaster')

            Assignee:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Reporter:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: