Atlas Device Sync Configuration Files
On this page
You can configure Atlas Device Sync for your application in the sync
directory:
app/ └── sync/ └── config.json
Sync Configuration
{ "type": "flexible", "development_mode_enabled": <Boolean>, "service_name": "<Data Source Name>", "database_name": "<Development Mode Database Name>", "state": <"enabled" | "disabled">, "client_max_offline_days": <Number>, "is_recovery_mode_disabled": <Boolean>, "queryable_fields_names": ["<Field Name>", ...], "indexed_queryable_fields_names": ["<Field Name>", ...], "collection_queryable_fields_names": { "<Collection Name>": ["<Field Name>", ...], ... } }
Field | Description |
---|---|
type string | The sync mode. There are two Sync modes: Flexible Sync and the older Partition-Based Sync. We recommend using Flexible Sync. For more information about Partition-Based Sync, refer to Partition-Based Sync. Valid Options for a Flexible Sync Configuration:
|
development_mode_enabled boolean | If |
service_name string | The name of the Atlas cluster data source to sync. You cannot use sync with a serverless instance. |
database_name string | The name of a database in the synced cluster where App Services stores data in Development Mode. App Services automatically generates a schema for each synced type and maps each object type to a collection within the database. |
state string | The current state of the sync protocol for the application. Valid Options:
|
client_max_offline_days number | The number of days that the backend compaction process waits before aggressively pruning metadata that some clients require to synchronize from an old version of a realm. |
is_recovery_mode_disabled boolean | If |
queryable_fields_names string[] | A list of field names to use as global queryable fields. |
indexed_queryable_fields_names string[] | A list of field names to use as the indexed queryable field. While this property is an array, Sync currently supports only one one indexed queryable field. Therefore, this array may contain at most one element. The indexed queryable field must be present in the schema and be
the same eligible field type in every collection you
sync. The indexed queryable field name must also appear in
|
collection_queryable_fields_names { [collectionName: string]: string[] } | A map from collection names to a list of collection-level queryable fields for each collection. |
last_disabled number | The date and time that sync was last paused or disabled, represented by the number of seconds since the Unix epoch (January 1, 1970, 00:00:00 UTC). |
asymmetric_tables string[] | An array of the names of collections that are defined as asymmetric with Data Ingest, where clients can write data but not read. |