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

mongosh db.runCommand along with db.createUser bug

    • Type: Icon: Bug Bug
    • Resolution: Community Answered
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      windows 11

      Using MongoDB: 7.0.12
      Using Mongosh: 2.3.0

    • Developer Tools
    • Not Needed

      The following command gets executed successfully and account gets created, however a shell error is thrown:

       

      Enterprise admin> db.runCommand(db.createUser( {user: "test111_3",pwd: "emad123",roles: [

      { role: "readWrite", db: "admin" }

      ]}) )
      MongoServerError[CommandNotFound]: no such command: 'ok'

       

      image is attached for reference.

       

      Regards,

      Emad Al-Mousa

       

       

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            emad.mousa@aramco.com emad mousa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: