Hello guys,
I’m setting up mongoDb realm sync using DotNet SDK. Have setup realm sync with:
Partition key ( _partition ) is set as not required in the sync setup.
Read permission : true
Write permission: based on user Id ( _partition )
On the client side, the realm is opened based on the user Id i.e.
user = await app.LogInAsync(Credentials.Anonymous());
config = new PartitionSyncConfiguration(user.Id, user);
I have 2 collections:
e.g. Task and ProjectSettings
Task collection has _partition that’s set to the userId and syncs with the local realm. The user is only able to see their own data.
ProjectSettings contains settings that apply to all users.
How would I setup ProjectSettings collection to sync on the client side irrespective of the partition key?
From other topics posted here I gathered it can be implemented by setting the _partition value to “Public”.
On the client side, setup a 2nd realm with this key.
Is there a better way to handle this scenario? Is my understanding incorrect that having Read permission : true should sync all data irrespective of _partition?
Or is this limited because the client side realm is being created with the userId as the parameter?
config = new PartitionSyncConfiguration(user.Id, user);
Appreciate any clarification on this.