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
28
28
29
29
{ addShard: "<hostname>:<port>" }
30
30
31
+ .. example::
32
+
33
+ .. code-block:: javascript
34
+
35
+ db.runCommand({addShard: "mongodb0.example.net:27027"})
36
+
31
37
Replace ``<hostname>:<port>`` with the hostname and port of the
32
38
database instance you want to add as a shard.
33
39
@@ -48,6 +54,12 @@ addShard
48
54
49
55
{ addShard: "replica-set/hostname:port" }
50
56
57
+ .. example::
58
+
59
+ .. code-block:: javascript
60
+
61
+ db.runCommand({ addShard: "repl0/mongodb3.example.net:27327"})
62
+
51
63
If you specify additional hostnames, all must be members of the same
52
64
replica set.
53
65
@@ -66,7 +78,7 @@ addShard
66
78
67
79
.. seealso::
68
80
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()
38
38
If you specify additional hostnames, all must be members of the same
39
39
replica set.
40
40
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
42
52
:dbcommand:`addShard` command.
43
53
The :dbcommand:`addShard` command has additional options which are
44
54
not available with this helper.
45
55
46
56
.. seealso::
47
57
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`
52
62
You can’t perform that action at this time.
0 commit comments