File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ addShard
2828
2929 { addShard: "<hostname>:<port>" }
3030
31+ .. example::
32+
33+ .. code-block:: javascript
34+
35+ db.runCommand({addShard: "mongodb0.example.net:27027"})
36+
3137 Replace ``<hostname>:<port>`` with the hostname and port of the
3238 database instance you want to add as a shard.
3339
@@ -48,6 +54,12 @@ addShard
4854
4955 { addShard: "replica-set/hostname:port" }
5056
57+ .. example::
58+
59+ .. code-block:: javascript
60+
61+ db.runCommand({ addShard: "repl0/mongodb3.example.net:27327"})
62+
5163 If you specify additional hostnames, all must be members of the same
5264 replica set.
5365
@@ -66,7 +78,7 @@ addShard
6678
6779 .. seealso::
6880
69- :method:`sh.addShard()`,
70- :doc:`/administration/sharding`,
71- :doc:`/tutorial/add-shards-to-shard-cluster`,
72- :doc:`/tutorial/remove-shards-from-cluster`
81+ * :method:`sh.addShard()`
82+ * :doc:`/administration/sharding`
83+ * :doc:`/tutorial/add-shards-to-shard-cluster`
84+ * :doc:`/tutorial/remove-shards-from-cluster`
Original file line number Diff line number Diff line change @@ -38,15 +38,25 @@ sh.addShard()
3838 If you specify additional hostnames, all must be members of the same
3939 replica set.
4040
41- The :method:`~sh.addShard()` method is a helper for the
41+ .. code-block:: javascript
42+
43+ sh.addShard("set-name/seed-hostname")
44+
45+ .. example::
46+
47+ .. code-block:: javascript
48+
49+ sh.addShard("repl0/mongodb3.example.net:27327")
50+
51+ The :method:`sh.addShard()` method is a helper for the
4252 :dbcommand:`addShard` command.
4353 The :dbcommand:`addShard` command has additional options which are
4454 not available with this helper.
4555
4656 .. seealso::
4757
48- :dbcommand:`addShard`,
49- :doc:`/administration/sharding`,
50- :doc:`/tutorial/add-shards-to-shard-cluster`,
51- :doc:`/tutorial/remove-shards-from-cluster`
58+ * :dbcommand:`addShard`
59+ * :doc:`/administration/sharding`
60+ * :doc:`/tutorial/add-shards-to-shard-cluster`
61+ * :doc:`/tutorial/remove-shards-from-cluster`
5262
You can’t perform that action at this time.
0 commit comments