@@ -91,6 +91,40 @@ Request Body Parameters
9191 - Required
9292 - Name of the destination cluster.
9393
94+ * - ``enableUserWriteBlocking``
95+ - boolean
96+ - Optional
97+ - If set to ``true``, blocks writes on the destination cluster
98+ while the synchronization is in progress. After the
99+ synchronization is committed to the destination cluster, the
100+ original source cluster blocks writes and the destination cluster
101+ accepts writes.
102+
103+ Default value is ``false``.
104+
105+ * - ``includeNamespaces``
106+ - array
107+ - Optional
108+ - Filters the databases or collections to sync. The filter syntax
109+ is:
110+
111+ .. include:: /includes/api/facts/includeNamespaces-syntax.rst
112+
113+ .. versionadded:: 1.1
114+
115+ If you configure a filter on a source cluster that has multiple
116+ databases, ``mongosync`` only syncs the databases specified in
117+ the filter definition. ``mongosync`` will not sync the other
118+ existing databases.
119+
120+ If you want to modify the filter to add a newly created database,
121+ you have to :ref:`restart the filtered sync <c2c-change-filter>`
122+ from the beginning.
123+
124+ For more details, see: :ref:`c2c-filtered-sync`.
125+
126+ For current limitations, see: :ref:`c2c-filtering-limitations`.
127+
94128 * - ``reversible``
95129 - boolean
96130 - Optional
@@ -118,18 +152,6 @@ Request Body Parameters
118152
119153 .. versionadded:: 1.1
120154
121- * - ``enableUserWriteBlocking``
122- - boolean
123- - Optional
124- - If set to ``true``, blocks writes on the destination cluster
125- while the synchronization is in progress. After the
126- synchronization is committed to the destination cluster, the
127- original source cluster blocks writes and the destination cluster
128- accepts writes.
129-
130- Default value is ``false``.
131-
132-
133155.. _c2c-api-start-sharding:
134156
135157Sharding Parameters
@@ -162,8 +184,8 @@ The ``sharding`` option has the following parameters:
162184 during sync.
163185
164186 Collections not included in this array sync to unsharded
165- collections on the destination cluster. If set with an empty array,
166- no collections are sharded.
187+ collections on the destination cluster. If set with an empty
188+ array, no collections are sharded.
167189
168190 * - | ``shardingEntries``
169191 | ``.collection``
@@ -190,18 +212,18 @@ The ``sharding`` option has the following parameters:
190212
191213``mongosync`` throws an error if the ``sharding`` option is not set when
192214syncing from a replica set to a sharded cluster. ``mongosync`` also
193- throws an error if the ``sharding`` option is set with any other configuration.
215+ throws an error if the ``sharding`` option is set with any other
216+ configuration.
194217
195218Response
196219--------
197220
198221.. include:: /includes/api/tables/basic-response.rst
199222
200- Example 1 - Start a Standard Sync Job
201- -------------------------------------
223+ Example: Start a Sync Job
224+ -------------------------
202225
203- The following example starts a synchronization job where ``cluster0`` is
204- the source and ``cluster1`` is the destination.
226+ .. include:: /includes/intro-start-api-example-intro.rst
205227
206228Request
207229~~~~~~~
@@ -216,12 +238,14 @@ Response
216238 :language: json
217239 :copyable: false
218240
219- Example 2 - Start a Reversible Sync Job
220- ---------------------------------------
241+ Example: Start a Reversible Sync Job
242+ ------------------------------------
221243
222- The following example starts a synchronization job where ``cluster0`` is
223- the source and ``cluster1`` is the destination. The ``reversible`` and
224- ``enableUserWriteBlocking`` fields allow the sync to be reversed.
244+ .. include:: /includes/intro-start-api-example-intro.rst
245+
246+ The ``reversible`` and ``enableUserWriteBlocking`` fields allow the sync
247+ to be reversed. To reverse the sync direction, see: :ref:`reverse
248+ <c2c-api-reverse>`.
225249
226250Request
227251~~~~~~~
@@ -236,18 +260,39 @@ Response
236260 :language: json
237261 :copyable: false
238262
239- Example 3 - Start Sync from Replica Set to Sharded Cluster
240- ----------------------------------------------------------
263+
264+ Example: Start a Filtered Sync Job
265+ ----------------------------------
266+
267+ .. include:: /includes/example-filter-collection.rst
268+
269+ The ``includeNamespaces`` option creates a filter. To filter the sync,
270+ see: :ref:`c2c-filtered-sync`
241271
242272Request
243273~~~~~~~
244274
245- .. literalinclude:: /includes/api/requests/start-rs-shard .sh
275+ .. literalinclude:: /includes/api/requests/start-filtered .sh
246276 :language: shell
247277
248278Response
249279~~~~~~~~
250280
281+ .. literalinclude:: /includes/api/responses/success.json
282+ :language: json
283+ :copyable: false
284+
285+ Example: Start Sync from Replica Set to Sharded Cluster
286+ -------------------------------------------------------
287+
288+ Request
289+ ~~~~~~~
290+
291+ .. literalinclude:: /includes/api/requests/start-rs-shard.sh
292+
293+ Response
294+ ~~~~~~~~
295+
251296.. literalinclude:: /includes/api/responses/success.json
252297 :language: json
253298 :copyable: false
0 commit comments