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 Device Sync configuration after you have already enabled Device Sync.

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

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

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

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

To add a queryable field, navigate to the Device 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 Device Sync to finish adding your queryable field and enable Device Sync.

Note

Devices using this new field will only be able to Device Sync on this field once the device has caught up to the point in time in Device 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 Device Sync to finish adding your queryable field and enable Device 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 Device 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 Device 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 Device Sync data with the new permissions applied.

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

  • Adding a new collection to a Device 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 Atlas Device SyncPause or Terminate Sync →
Give Feedback
© 2022 MongoDB, Inc.

About

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