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

db.runCommand and the admin database

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • v1.3.1
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved:
              10 years, 10 weeks, 4 days ago