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

example for shard collection command is incorrect

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      Error on this page:
      http://docs.mongodb.org/manual/administration/sharding/#set-up-a-sharded-cluster

      It says:

       To shard a collection, run the shardCollection command or the sh.shardCollection() shell helper.
       
      db.runCommand( { shardCollection: "<database>.<collection>", key: "<shard-key>" } )

      This actually doesn't work though. The syntax must be key:

      { "shardkey": 1 }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 10 weeks, 2 days ago