Skip to content

Commit b9c677f

Browse files
kennethdyerajayvijayakumar123ajhuh-mdbmdb-ashleyianf-mongodb
authored
DOCSP-33176 restore 1.6 Content (#164)
* DOCSP-32917 mongosync 1.6 Release Notes (#160) * DOCSP-32917 1.6.0 Release Notes * Adds RN's * Adds RN's * Adds RN's * Minor edits * Fixes per Jeff * Fixes per Ajay * Fixes per Ajay and Dave * Fixes per Ajay Co-authored-by: Ajay Vijayakumar <[email protected]> * Fixes per Ajay * Fixes typo --------- Co-authored-by: Ajay Vijayakumar <[email protected]> * DOCSP-31922 Filtered Sync Improvements (#154) * DOCSP-31922 Regex and Exclude Filter Sync * Fixes build error * Removes fitler syntax from table * Adds filter syntax * Adds intro * Minor fix to trigger build * Adjusts intro text * Nests intro under versionchanged * Adjusts intro text * Adjusts intro text * Adjusts intro text * Adjusts intro text * Adjusts intro text * Expands Configure Filter step * Expands Use Filter step * Test alternate syntax highlighter * Fixes syntax highlighting options * Stubs Filter Regex * Stubs Filter Regex * Moves regex to new directory * Fixes build issue * Fixes build issue * Fixes build issue * Fixes build issue * Populates syntax documentation * Populates syntax documentation * Adds regex options * Adds regex options * Adds learn more link * Adds use case * Fixes build error * Fixes build error * Adds release notes * Fixes per Ali * Fixes per Ali Co-authored-by: Alison Huh <[email protected]> * Fixes per Ali * Fixes per Ali Co-authored-by: Alison Huh <[email protected]> * Fixes per Ali * Fixes per Ali * Fixes per Tim and Jessica * Fixes per Jessica * Fixes per Jessica * Fixes per Ashley Co-authored-by: Ashley Brown <[email protected]> --------- Co-authored-by: Alison Huh <[email protected]> Co-authored-by: Ashley Brown <[email protected]> * DOCSP-29502 7.0 support (#152) * DOCSP-29502 7.0 Support for mongosync 1.6 * Fixes per Ajay * Adds upcoming notice * gq tet * Fixes build issue * Fixes per Michael * Fixes per Michael * Fixes per Ian * Fixes per Ian Co-authored-by: ianf-mongodb <[email protected]> --------- Co-authored-by: Ajay Vijayakumar <[email protected]> Co-authored-by: Alison Huh <[email protected]> Co-authored-by: Ashley Brown <[email protected]> Co-authored-by: ianf-mongodb <[email protected]>
1 parent 9f18861 commit b9c677f

File tree

8 files changed

+375
-23
lines changed

8 files changed

+375
-23
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ toc_landing_pages = ["/quickstart",
2424
]
2525

2626
[constants]
27-
version = "1.0"
27+
version = "1.6"
2828
c2c-product-name = "Cluster-to-Cluster Sync"
2929
c2c-full-product-name = "MongoDB Cluster-to-Cluster Sync"
3030
mdb-download-center = "`MongoDB Download Center <https://www.mongodb.com/try/download/mongosync>`__"

source/reference/api/start.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ Request Body Parameters
143143

144144
.. versionadded:: 1.1
145145

146+
* - ``excludeNamespaces``
147+
- array
148+
- Optional
149+
- Filters the databases or collections to exclude from sync.
150+
151+
.. include:: /includes/api/facts/namespace-explanation.rst
152+
153+
.. versionadded:: 1.6
154+
146155
* - ``reversible``
147156
- boolean
148157
- Optional

source/reference/collection-level-filtering.txt

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,34 @@ Filtered Sync
1818
.. include:: /includes/api/facts/filtering-intro.rst
1919

2020
Starting in 1.1, ``mongosync`` supports inclusion filters to specify which
21-
databases and collections to include in sync.
21+
databases and collections to include in sync. Starting in 1.6, ``mongosync``
22+
also supports exclusion filters and regular expressions.
2223

2324
- With inclusion filters, ``mongosync`` syncs matching
2425
databases and collections.
26+
- With exclusion filters, ``mongosync`` syncs all databases
27+
and collections, except for those that match the filters.
28+
- With both inclusion and exclusion filters, ``mongosync`` only syncs
29+
databases and collections that match the inclusion filters then excludes
30+
any that also match the exclusion filters.
2531
- With no filters, ``mongosync`` syncs all databases and collections.
2632

2733
.. _c2c-filter-syntax:
2834

2935
Filter Syntax
3036
-------------
3137

32-
The :ref:`c2c-api-start` API endpoint accepts one field to configure filtered
33-
sync: ``includeNamespaces``. This field takes an array of filters to specify
34-
the databases and collections to include in the sync.
38+
The :ref:`c2c-api-start` API endpoint accepts two fields that configure
39+
filtered sync: ``includeNamespaces`` and ``excludeNamespaces``.
40+
Each field takes an array of filters that specify the databases and collections
41+
to include or exclude from sync.
42+
43+
.. note::
44+
45+
If the :ref:`c2c-api-start` call uses both ``includeNamespaces`` and
46+
``excludeNamespaces`` parameters, ``mongosync`` first matches databases
47+
and collections from the inclusion filters, then excludes those that
48+
also match an exclusion filter.
3549

3650
Filters have the following syntax:
3751

@@ -44,10 +58,38 @@ Filters have the following syntax:
4458
"collections": [
4559
"<collection-name>"
4660
]
61+
"databaseRegex": {
62+
"pattern": "<regex-pattern>",
63+
"options": "<options>"
64+
},
65+
"collectionRegex": {
66+
"pattern": "<regex-pattern>",
67+
"options": "<options>"
68+
}
69+
}
70+
],
71+
"excludeNamespaces": [
72+
{
73+
"database": "<database-name>",
74+
"collections": [
75+
"<collection-name>"
76+
]
77+
"databaseRegex": {
78+
"pattern": "<regex-pattern>",
79+
"options": "<options>"
80+
},
81+
"collectionRegex": {
82+
"pattern": "<regex-pattern>",
83+
"options": "<options>"
84+
}
4785
}
4886
]
4987

50-
Filters must include the ``database`` field.
88+
Filters must include either the ``database`` field or the ``databaseRegex`` field.
89+
90+
If you need the filter to match specific collections, you can use either
91+
the ``collections`` array to specify collections individually or define
92+
a regular expression using the ``collectionRegex`` field.
5193

5294
.. _c2c-configure-filter:
5395

@@ -66,41 +108,53 @@ Configure a Filter
66108
.. step:: Identify Databases and Collections.
67109

68110
Identify the databases and collections that you want to sync to
69-
the destination cluster. When you add a set of databases to the
70-
filter, you also exclude any other databases in the cluster.
111+
the destination cluster.
112+
113+
- When you add a set of databases to the filter, you also exclude any
114+
other databases in the cluster.
71115

72-
When you specify a collection in your filter, you also exclude any
73-
other collections that are in the same database.
116+
- When you specify a collection in your filter, you also exclude any
117+
other collections that are in the same database.
74118

75119
.. step:: Create a Filter.
76120

77-
The :ref:`c2c-api-start` API accepts a parameter to configure a series of
121+
The :ref:`c2c-api-start` API accepts two parameters that configure
78122
optional filters:
79123

80124
- The ``includeNamespaces`` parameter takes an array of filters, which
81125
are used to determines which databases and collections ``mongosync``
82126
should include in the sync.
127+
- The ``excludeNamespaces`` parameter takes an array of filters, which
128+
are used to determine which databases and collections ``mongosync``
129+
should exclude from the sync.
83130

84131
If you don't specify a filter, ``mongosync`` performs a full cluster
85132
sync.
86133

87-
Create inclusion filters to identify the databases and
134+
Create inclusion and/or exclusion filters to identify the databases and
88135
collections you want to sync.
89136

90137
For example, this inclusion filter would configure ``mongosync`` to only
91-
sync ``accounts_us`` and ``accounts_eu`` collections in the ``sales``
92-
database.
138+
sync collections whose names begin with ``accounts_`` from the ``sales``
139+
database, except for the ``accounts_old`` collection:
93140

94141
.. code-block:: json
95142

96143
"includeNamespaces": [
97144
{
98145
"database": "sales",
99-
"collections": [
100-
"accounts_us",
101-
"accounts_eu",
102-
]
103-
}
146+
"collectionRegex": {
147+
"pattern": "^accounts_.+?$",
148+
"options": "ms"
149+
}
150+
],
151+
"excludeNamespaces": [
152+
{
153+
"database": "sales",
154+
"collections": [
155+
"accounts_old"
156+
]
157+
}
104158
]
105159

106160
For more information on filters, see :ref:`c2c-filter-syntax`.
@@ -298,3 +352,8 @@ Adding and Renaming Collections While Syncing
298352

299353
.. include:: /includes/example-filter-collection-with-renaming.rst
300354

355+
.. toctree::
356+
:hidden:
357+
358+
/reference/collection-level-filtering/filter-regex
359+
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.. _c2c-filter-regex:
2+
3+
##############################
4+
Regular Expressions in Filters
5+
##############################
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: twocols
14+
15+
.. versionadded:: 1.6
16+
17+
.. include:: /includes/api/facts/filter-regex
18+
19+
Syntax
20+
======
21+
22+
To match databases and collections for ``mongosync`` to use :ref:`c2c-filtered-sync`,
23+
you can use regular expressions:
24+
25+
.. code-block:: json
26+
:copyable: false
27+
28+
{
29+
"databaseRegex": {
30+
"pattern": "<string>",
31+
"options": "<string>"
32+
},
33+
"collectionRegex": {
34+
"pattern": "<string>",
35+
"options": "<string>"
36+
}
37+
}
38+
39+
Regular expressions in filter documents use the following fields:
40+
41+
.. list-table::
42+
:header-rows: 1
43+
44+
* - Option
45+
- Type
46+
- Description
47+
48+
* - ``collectionRegex``
49+
- document
50+
- Specifies which collections you want the filter
51+
to match.
52+
53+
* - ``collectionRegex.options``
54+
- string
55+
- Regular expression options to use in the match.
56+
57+
* - ``collectionRegex.pattern``
58+
- string
59+
- Regular expression pattern to match.
60+
61+
62+
* - ``databaseRegex``
63+
- document
64+
- Specifies which databases you want the filter
65+
to match.
66+
67+
* - ``databaseRegex.options``
68+
- string
69+
- Regular expression options to use in the match.
70+
71+
* - ``databaseRegex.pattern``
72+
- string
73+
- Regular expression pattern to match.
74+
75+
These options are available to use with both the ``includeNamespaces``
76+
and ``excludeNamespaces`` parameters.
77+
78+
Use Cases
79+
=========
80+
81+
Regular expressions allow you match multiple databases or collections with a
82+
single pattern. If you want to match multiple similarly named
83+
databases or collections, a regular expression may be easier to match than
84+
creating a series of filters for individual databases or groups of collections.
85+
86+
Details
87+
=======
88+
89+
Regular Expression Options
90+
--------------------------
91+
92+
``databaseRegex`` and ``collectionRegex`` each supports an ``options`` field,
93+
which you can use to configure regular expression options.
94+
Internally, ``mongosync`` passes the filter and options to the
95+
:query:`$regex` operator. Options available to that operator can be used
96+
with Filtred Sync.
97+
98+
For example, this filter would match collections in the ``sales`` database
99+
that begin start with the ``accounts_`` string:
100+
101+
.. code-block:: json
102+
103+
"includeNamespaces": [
104+
{
105+
"database": "sales",
106+
"collectionRegex": {
107+
"pattern": "^accounts_.+?$",
108+
"options": "ms"
109+
}
110+
}
111+
]
112+
113+
Learn More
114+
==========
115+
116+
* :ref:`c2c-filtered-sync`

source/reference/limitations.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ General Limitations
3232
6.2. The minimum supported server version is MongoDB 6.0.5.
3333
For more information on MongoDB versioning, see
3434
:ref:`release-version-numbers`.
35-
- The source and destination clusters must have the same release version.
35+
- The source and destination clusters must have the same major and minor
36+
release version, but can have different patch releases.
37+
38+
For example,
39+
40+
- ``mongosync`` supports sync from a MongoDB 6.0.8 source cluster to a
41+
MongoDB 6.0.9 destination cluster, since these are patch releases
42+
of the same major release.
43+
- ``mongosync`` does not support sync from a MongoDB 6.0.9 source cluster to
44+
a MongoDB 7.0.0 destination cluster, since they have different major
45+
versions.
3646
- The minimum supported :dbcommand:`Feature Compatibility Version
3747
<setFeatureCompatibilityVersion>` is 6.0.
3848
- The source and destination clusters must have the same Feature

source/reference/versioning.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ Same Server Version
6060
~~~~~~~~~~~~~~~~~~~
6161

6262
{+c2c-product-name+} only supports syncing between the same version of
63-
MongoDB Server. All three :ref:`server version numbers
64-
<release-version-numbers>`, including the patch number, must be the
65-
same on both servers.
63+
MongoDB Server. The major and minor :ref:`server version numbers
64+
<release-version-numbers>` must be the same on both clusters.
65+
Starting in ``mongosync`` 1.6.0, the source and destination cluster
66+
can use different patch releases of the same major and minor version.
6667

6768
Support Lifecycle
6869
~~~~~~~~~~~~~~~~~

source/release-notes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Release Notes
88
.. toctree::
99
:titlesonly:
1010

11+
/release-notes/1.6
1112
/release-notes/1.5
1213
/release-notes/1.4
1314
/release-notes/1.3

0 commit comments

Comments
 (0)