Maybe you should first read the documentation of using CosmosDB:
here
On this page you can see how you can query your product and then delete this record from your collection:
var query = client.CreateDocumentQuery<YourDocumentModel>(UriFactory.CreateDocumentCollectionUri(databaseName, collectionName),
"<your sql>",
queryOptions);
with this result you can update the object (yourDocumentModelObject
) and remove the product from the subcategory.
Afterwards save it back to the collection in doing something like:
await client.UpsertDocumentAsync<YourDocumentModel>(UriFactory.CreateDocumentCollectionUri(databaseName, collectionName),
yourDocumentModelObject);
solved How to delete a Product