Skip to content

Commit fbc933a

Browse files
committed
(DOCSP-15472): [Config Files] Sync
1 parent 3ba98cf commit fbc933a

File tree

2 files changed

+30
-98
lines changed

2 files changed

+30
-98
lines changed

source/config/data_sources.txt

-94
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ MongoDB Clusters
4040
"config": {
4141
"clusterName": "<Atlas Cluster Name>",
4242
"readPreference": "<Read Preference>",
43-
"sync": { <Sync Configuration> },
4443
"wireProtocolEnabled": <Boolean>
4544
}
4645
}
@@ -75,103 +74,11 @@ MongoDB Clusters
7574

7675
.. include:: /mongodb/tables/read-preference-modes.rst
7776

78-
* - | ``config.sync``
79-
| Document
80-
- A configuration document that determines if a cluster is :doc:`synced
81-
</sync>` and, if it is, defines the rules for sync operations on the
82-
cluster.
83-
84-
For detailed information on sync configuration documents, see
85-
:ref:`Synced Cluster Configuration <config-synced-cluster>`.
86-
8777
* - | ``config.wireProtocolEnabled``
8878
| Boolean
8979
- If ``true``, clients may :ref:`connect to the app over the MongoDB Wire
9080
Protocol <wire-protocol-connect>`.
9181

92-
.. _config-synced-cluster:
93-
94-
Synced Cluster Configuration
95-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96-
97-
The ``config.sync`` field of ``config.json`` determines if a cluster is
98-
:doc:`synced </sync>` and, if it is, defines the rules for sync operations on
99-
the cluster.
100-
101-
.. code-block:: json
102-
:caption: config.json
103-
104-
{
105-
...,
106-
"config": {
107-
...,
108-
"sync": {
109-
"state": <Boolean>,
110-
"development_mode_enabled": <Boolean>,
111-
"database_name": "<Developer Mode Database Name>",
112-
"partition": {
113-
"key": "<Partition Key Field Name>",
114-
"type": "<Partition Key Value Type>",
115-
"permissions": {
116-
"read": <JSON Expression>,
117-
"write": <JSON Expression>
118-
}
119-
}
120-
}
121-
}
122-
}
123-
124-
.. list-table::
125-
:header-rows: 1
126-
:widths: 10 30
127-
128-
* - Field
129-
- Description
130-
131-
* - | ``sync.state``
132-
| Boolean
133-
- If ``true``, :doc:`Sync </sync>` is enabled for the cluster, which means
134-
that client applications can sync data in the cluster with Realm Database
135-
and that :ref:`non-sync collection rules <mongodb-service-rules>` do not
136-
apply.
137-
138-
* - | ``sync.development_mode_enabled``
139-
| Boolean
140-
- If ``true``, :term:`development mode` is enabled for the cluster. While
141-
enabled, Realm automatically stores synced objects in a specific database
142-
within the cluster and mirrors objects types in that database's
143-
collection schemas.
144-
145-
.. important::
146-
147-
Realm does not enforce rules when development mode is enabled.
148-
149-
* - | ``sync.database_name``
150-
| String
151-
- The name of the database in the synced cluster where Realm should store
152-
synced objects.
153-
154-
When :term:`development mode` is enabled, Realm stores synced objects in
155-
this database. Each object type maps to its own collection in the
156-
database with a schema that matches the synced objects.
157-
158-
* - | ``sync.partition.key``
159-
| String
160-
- The name of the field that :ref:`partitions <partitioning>` data into
161-
client Realms.
162-
163-
* - | ``sync.partition.type``
164-
| String
165-
- The type of the partition key field value.
166-
167-
* - | ``sync.partition.permissions``
168-
| Document
169-
- A document that defines the ``read`` and ``write`` permissions for the
170-
synced cluster. Permissions are defined with :ref:`rule expressions
171-
<expressions>` that Realm evaluates per-user, per-partition. The
172-
expressions have access to the :json-expansion:`%%user` and
173-
:json-expansion:`%%partition` expansions.
174-
17582
.. _config-datalake:
17683

17784
MongoDB Data Lakes
@@ -211,7 +118,6 @@ MongoDB Data Lakes
211118
| String
212119
- Required. The name of the data lake in Atlas.
213120

214-
215121
Databases & Collections
216122
-----------------------
217123

source/config/sync.txt

+30-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ Configuration
2929

3030
{
3131
"state": <"enabled" | "disabled">,
32-
"development_mode_enabled": <Boolean>
32+
"development_mode_enabled": <Boolean>,
33+
"database_name": "<Development Mode Database Name>",
3334
"partition": {
3435
"key": "<Partition Key Field Name>",
3536
"type": "<Partition Key Type>",
3637
"permissions": {
3738
"read": { <JSON Expression> },
3839
"write": { <JSON Expression> }
3940
}
40-
}
41+
},
42+
"last_disabled": <Number>
4143
}
4244

4345
.. list-table::
@@ -49,17 +51,35 @@ Configuration
4951

5052
* - | ``state``
5153
| String
52-
- The current state of the Sync protocol for the application.
54+
- The current state of the :doc:`Sync </sync>` protocol for the application.
5355

5456
Valid Options:
5557

5658
- ``"enabled"``
5759
- ``"disabled"``
5860

61+
* - | ``service_name``
62+
| String
63+
- The name of the Atlas cluster :ref:`data source <appconfig-data_sources>`
64+
to sync.
65+
5966
* - | ``development_mode_enabled``
6067
| Boolean
6168
- If ``true``, :ref:`development mode <enable-development-mode>` is enabled
62-
for the application.
69+
for the application. While enabled, Realm automatically stores synced
70+
objects in a specific database (specified in ``database_name``) and
71+
mirrors objects types in that database's collection schemas.
72+
73+
.. important::
74+
75+
Realm does not enforce rules when development mode is enabled.
76+
77+
* - | ``database_name``
78+
| String
79+
- The name of a database in the synced cluster where Realm stores data in
80+
:ref:`development mode <enable-development-mode>`. Realm automatically
81+
generates a schema for each synced type and maps each object type to a
82+
collection within the database.
6383

6484
* - | ``partition.key``
6585
| String
@@ -91,3 +111,9 @@ Configuration
91111
has permission to write objects in a partition. If the expression
92112
evaluates to ``false``, {+service-short+} does not allow the user to
93113
modify an object or its properties.
114+
115+
* - | ``last_disabled``
116+
| Number
117+
- The date and time that sync was last paused or disabled, represented by
118+
the number of seconds since the Unix epoch (January 1, 1970, 00:00:00
119+
UTC).

0 commit comments

Comments
 (0)