Enable Atlas Device Sync
Overview
You can enable Atlas Device Sync via the App UI, Realm CLI, or the App Services Admin API. If it is your first time enabling Device Sync, the UI is a great choice because it walks you through the required steps.
If you're re-enabling it after pausing or terminating it, see: Resume or Re-Enable Device Sync.
Prerequisites
While you are configuring Atlas Device Sync, you must define the data access patterns and rules for your App. If you haven't already decided how you want to configure your data model and access Device Sync, see:
Before defining sync rules and enabling sync, you must specify at least one valid schema for a collection in the synced cluster unless you are using Development Mode.
At a minimum, the schema must define _id
and the field that you intend to
use as your partition key. A partition key field may be a string
,
integer
, or objectId
.
For more details on how to define a schema, see Enforce a Schema.
Enable Partition-Based Sync
Enable Flexible Sync
Enabling Flexible Sync in Your App Services Application requires a non-sharded MongoDB Atlas cluster running MongoDB 5.0 or greater