Would Opening a Realm with Particular Partition Sync All Data from That Partition to Local Device

Hi,

I believe it is the case that when we opened a particular realm/partition, the data from that realm/partition will be fully synced to local device even though we are only accessing some of the data.
Am I right?

Thanks,
Vincent

Hello Vincent,

Thanks for raising the query. You are right, all data is synced if user has permissions to open a particular realm.

However you can have your local schema, a subset of your server schema, all data will still be downloaded but you access fields that are required in your app.

Please Note, client schema should conform to server schema for Sync to happen.

I hope this clarifies.

Please don’t hesitate to ask, if you have any further questions.

Kind Regards,
Henna

1 Like

Hi Henna,

Thanks for the reply.
The explanations shall hold true as well regarding accessing multiple documents/objects in a collection will still sync the whole collection of that particular realm/partition to local device.
Is that right?

Hello Vincent,

Which Realm SDK are you using to build your Realm App? Some helpful articles can be found on MongoDB Dev-Hub for several SDKs.

All your documents should have a partitionKey field and a value associated with it depending on what strategy you follow. The partition value is needed when you open a synced Realm. All the documents that have the same partition value will be synced to your local device.

I hope this helps.

Please let us know if you have further questions.

Kind Regards,
Henna

I am using NodeJS SDK with Electron but referring to some React Native codes as I am using React in Electron.

Thanks,
Vincent

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.