I'm working with Azure Cosmos DB and have a scenario where I need to check for data in one container (e.g., ContainerA) before inserting data into another container (e.g., ContainerB).
I initially considered using stored procedures for this purpose, but I encountered the following error:
Function is not allowed to operate on resources outside current collection
It appears that stored procedures in Cosmos DB can't operate across multiple collections.
Could someone suggest alternative ways to achieve this within the database itself? I'm aiming to avoid handling this logic in client-side code.
Any help or pointers would be greatly appreciated!