Docs Menu
Docs Home
/ /
Atlas App Services
/ /

Atlas Device Sync Configuration Files

On this page

  • Sync Configuration

You can configure Atlas Device Sync for your application in the sync directory:

app/
└── sync/
└── config.json
sync/config.json
{
"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:

  • "flexible"

development_mode_enabled
boolean
If true, Development Mode is enabled for the application. While enabled, App Services automatically stores synced objects in a specific database (specified in database_name) and mirrors objects types in that database's collection schemas.
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:

  • "enabled"

  • "disabled"

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 false, Recovery Mode is enabled for the application. While enabled, Realm SDKs that support this feature attempt to recover unsynced changes upon performing a client reset. Recovery mode is enabled by default.
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 queryable_fields_names since this is a global queryable field.

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.

Back

Log Forwarders

On this page