Rank 1: Thread
I am having user cart document with a respective user can read and update permission. Each cart document is 1-1 relationship with user and 1-many realtionship with product documents. When a user removes a product. I am changing the cart products like. this
const removedProductId ="aadfasdfasdf"; db.updateDocument({products: document.products.filter(p => p.$id !== removedProductId)}) //assume dbID, colID, docID is givenIf there is single product in a cart. It is removing without throwing an error. otherwise it is saying the current user is not authorized to perform the requested action.