Using the sample data provided by Atlas, can someone show me an example of how you would do the following using Realm?
-Using the sample_analytics collection create the following relationships
- One transaction is linked to one customer by saving the customer_id in it’s schema. I understand that the sample data is designed to link transactions to accounts however for my example i would prefer if both transactions and accounts are linked directly to the customer.
- One account is linked to one customer by saving the customer_id in it’s schema
- A customer returns an array of all the transactions that are linked to it
- A customer returns an array of all the accounts linked to it.
Following this example you would need to insert all account id’s in the customer accounts array and then would not be able to get the customer details from the accounts collection. How can you link an account to one customer to be able to get customer details, but then get all accounts related to a particular customer from the customer document?