Docs Menu

Alter Your Sync Configuration

On this page

  • Overview
  • Alter Your Partition-Based Sync Configuration
  • Alter Your Flexible Sync Configuration

You may want to alter your Sync configuration after you have already enabled Sync.

If you are using Partition-Based Sync, and want to change the Partition Key, you can terminate and re-enable Sync.

If you are using Flexible Sync and want to add or remove queryable fields, you can do so immediately, without terminating Sync.

You must Terminate Sync and Re-enable Sync to make changes to your Partition-Based Sync Configuration. While you are re-enabling Realm Sync, you can specify a new Partition Key, or changes to your Read/Write Permissions. Making changes to your Sync configuration while terminating and re-enabling Sync will trigger a client reset. To learn more about handling client resets, read the client reset documentation.

To alter your Flexible Sync Configuration, you can add or remove fields in the Realm UI while Sync is enabled without terminating and re-enabling Sync.

To add a queryable field, navigate to the Sync configuration screen through the left navigation menu. Under the Select Queryable Fields heading, you can create a new field(s) to construct a query on. Finally, make sure to click Enable Sync to finish adding your queryable field and enable Sync.

Note

Devices using this new field will only be able to Sync on this field once the device has caught up to the point in time in Sync History where the field was added.

Add a Queryable Field

To remove a queryable field, navigate to the Sync configuration screen through the left navigation menu. Under the Select Queryable Fields heading, you can click the x button next to the field you wish to delete. Finally, make sure to click Enable Sync to finish adding your queryable field and enable Sync.

Note
Removing a Queryable Field Triggers a Client Reset on Devices Using That Field

When you remove a queryable field, any devices still using that field will have their Sync session dropped and receive a client reset. To learn more about handling client resets, read the client reset documentation. Clients that are not using this field, will continue syncing data normally without receiving any errors. To avoid triggering a client reset when you remove the queryable field in the Sync configuration screen, you should also remove this field on the client-side.

Remove a Queryable Field

Making changes to permissions, whether implicitly through user metadata, or explicitly through changing configuration filters, will trigger a client reset and re-download of all Sync data with the new permissions applied.

A client reset will not be triggered under the following cases:

  • Adding a new collection to a Sync schema, and defining permissions for the new namespace or using default roles. This will not trigger a client reset because permissions have not been applied previously.
  • Configuring custom permissions for the new collection in the same draft as the new schema. Conversely, deploying a draft with permission changes after you deploy the schema will lead to a client reset, since default permissions were applied in the initial deployment.
←  Enable Realm SyncPause or Terminate Sync →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.