Hello, I’m trying to create an app where user accounts are synced, and the app pulls bank transactions that are stored in the database. Each user can have multiple accounts, and each transaction is stored with its account ID and the transaction ID. Transaction IDs are guaranteed to be unique within a single bank account, but not across different bank accounts, so I need both the account ID and the transaction ID to uniquely identify a single transaction.
How can I ensure uniqueness across both of these fields? For example, if two phones using the same account separately import the same set of transactions, then those documents are replicated, how can I prevent duplicates from being synced?
From some preliminary Googling, I think the answer is to use compound keys, but I’m having trouble finding any documentation about creating/querying compound keys in CBL 2.0.