Force sync for MongoDB Atlas

Hello

Is there a way to do a force atlas sync?

Hello @Roman_Bayik ,

Are you referring to Atlas Device Sync?
If yes, then can you please share more details such as:

  • What are your requirements?
  • Please confirm if you have enabled Device Sync for your App?
  • Which SDK are you using?

Check out the tutorial

If you prefer to learn by example, check out the App Services tutorial, which describes how to build a synced to-do list application with clients for common platforms that App Services supports.

Regards,
Tarun

Hello
Thank you for the questions.

Yes, I’m about Atlas Device Sync.

  • I need to have a force sync (you click on Sync button and atlas begins a process of syncing)
  • yes, syncing is working well as expected
  • well, the latest one from SPM

hey @Roman_Bayik What do you mean by force sync?

When you enable Device Sync on Atlas the cloud will now expose an endpoint for you to connect devices to that will synchronize data to and from the cloud automatically. You access the cloud endpoint by using one of the Realm SDKs -

There is also a separate forums topic on Atlas Device Sync here -

Hello @Ian_Ward ,
I mean it is not defined that Atlas will sync data instantly right after the change (maybe it is how it works, but I didn’t find a concrete statement about it), so I’m looking for a possibility of making force sync just to make sure all data is synced.

Did you find any solution ?

Atlas and Device Sync will sync immediately after a change is made. The client will receive this change a short but indeterminate amount of time after the change.

If you want to ensure that the client has “caught up” to the latest version of data persisted in the cloud, you can use waitForDownload in the realm SDK: https://www.mongodb.com/docs/realm/sdk/flutter/sync/manage-sync-session/#wait-for-changes-to-upload-and-download

1 Like