John Pham
John Pham

Reputation: 65

How to map my json path into cosmos db from Azure Data Factory

I'm trying to add entries into my cosmosdb using Azure Data Factory - However i am not able to choose the right collection as Azure Data Factory can only see the top level of the database.

enter image description here Is there any funny syntax for choosing which collection to pick from Cosmos DB SQL API? - i've tried doing, entities[0] and entities['tasks'] but none of them seem to work

enter image description here

enter image description here

The new entries are inserted as we see in the red box, how do i get the entries into the entries collection?

enter image description here

enter image description here

Upvotes: 1

Views: 1051

Answers (1)

suziki
suziki

Reputation: 14113

Update:

enter image description here

Original Answer:

If the requirement you mentioned in the comments is what you need, then it is possible. For example, to put JSON data into an existing ‘tasks’ item, you only need to use the upsert method, and the source json data has the same id as the ‘tasks’ item.

This is the offcial doc:

https://learn.microsoft.com/en-us/azure/data-factory/connector-azure-cosmos-db#azure-cosmos-db-sql-api-as-sink

The random letters and numbers in your red box appear because you did not specify the document id.

Have a look of this:

enter image description here

By the way, if the tasks have partitional key, then you also need to specify.

Upvotes: 1

Related Questions