How to insert/update Target document based on Value in another Source document at different container at Azure CosmosDB ?

Mehboob Ahmad 61 Reputation points
2022-08-30T06:46:09.08+00:00

During Upsets Data From Data warehouse to container (A) at Cosmos Db.
The problem that i need Upsets data in container (b) base on Value in container (A).
if value exist in container (b) update count in document else insert new document in container (b)

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,494 questions
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 28,462 Reputation points Microsoft Employee
    2022-09-06T22:10:32.567+00:00

    @Mehboob Ahmad No. Stored procedures and triggers execute within the context of a single container and logical partition key.

    In this example, Both data types should be stored in a single container with a property to discern between the “model” type and “serial” type. For example, if we had an airline database where every ticket booking also generates a seat reservation item, we would include both types of items within a single container.

    However, if you want to respond to something happening to your model container, say a new item is inserted or an existing item is updated. Then check a specific property value and use that to then do something else in your Serial container, that’s something you can do using Change Feed. In that scenario, I would not store the data in the same container.

    Regards
    Geetha

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful