Trying to model a standard Salesforce mobile app on MongoDB Realm.
The obvious partitioning is to use the salesman as my partition key. This way, I can sync all stores and invoices of each salesman in their own partition.
However, salesman can cross each other stores in certain cases. One salesman can see the stores of other salesman, but should not be able to see its previous invoices.
The original salesman need to see the invoices of his stores even if created by the other salesman.
Can I create multiple partitions to the same dataset?
_partitionKey: "salesman_id=1234"
_partitionKey: "store_id=abcdefg"
and get the required data based on the prefix of the partition key.
or
Do I need to duplicate the data for 2 objects?
Object for the salesman with
_partitionKey: "salesman_id=1234"
and object for the store with _partitionKey: "store_id=abcdefg"
or is there other way to solve this?