Created
April 2, 2015 21:48
-
-
Save danared/135c8134b7d3583b5697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mongo | |
MongoDB shell version: 2.6.7 | |
connecting to: test | |
mongos> sh.enableSharding( "test" ) | |
{ "ok" : 1 } | |
mongos> sh.shardCollection( "test.mycollection", { _id : 1 }, true ) | |
{ "collectionsharded" : "test.mycollection", "ok" : 1 } | |
mongos> db.mycollection.insert( { _id : 1, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) | |
mongos> db.mycollection.insert( { _id : 3, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) | |
mongos> db.mycollection.insert( { _id : 5, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) | |
mongos> db.mycollection.insert( { _id : 7, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) | |
mongos> db.mycollection.insert( { _id : 9, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) | |
mongos> db.mycollection.insert( { _id : 11, data : "hello" } ) | |
WriteResult({ "nInserted" : 1 }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment