Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2672

db.runCommand and the admin database

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • v1.3.1
    • None
    • manual
    • None

    Description

      The runCommand doesn't mention if "use admin" is always required (in a sharded environment?).
      use admin to successfully execute is certainly required a lot, so I believe this page should mention it.
      http://docs.mongodb.org/manual/reference/method/db.runCommand/

      Further more, this page doesn't mention that "use admin" is required:
      http://docs.mongodb.org/manual/reference/command/addShard/#dbcmd.addShard
      It is, and the error message with ZERO shards is:
      mongos> db.runCommand(

      {addShard:"rs1/addShard:charlie-VirtualBox:27012", name:"shard01"}

      )
      Wed Feb 5 15:15:37.422 error: {
      "$err" : "error creating initial database config information :: caused by :: can't find a shard to put new db on",
      "code" : 10185
      } at src/mongo/shell/query.js:128

      Which is very hard to figure out.

      Further shards require "use admin" but they kindly tell.

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            charlie.page@10gen.com Charlie Page
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 50 weeks, 5 days ago