I know it is better to convert xml to json to store it in CosmosDb especially to query documents using SQL API. But will it be OK to flatten xml data to store it inside of a document then query them using SQL API? Not even sure if SQL API support xml query or not.
Asked
Active
Viewed 503 times
2 Answers
2
The simple answer is NO :(
The CosmosDB is stores JSON documents: https://learn.microsoft.com/en-us/azure/cosmos-db/introduction
Depending the choosen API, you can handle these JSON documents in graph model (Gramlin), or in document collection (MongoDb, DocumentDB). Or SQL etc... But the result is always an JSON document.
But there are a lot of tools to convert XML to JSON and convert back. Here is a discussion about it: How to convert JSON to XML or XML to JSON?
I hope it helps.
Regards gy

Chris.ZA
- 1,218
- 1
- 15
- 30

György Gulyás
- 1,290
- 11
- 37
1
Per my knowledge, it is not possible. More information for your reference: Query Azure Cosmos DB data with SQL queries

Lee Liu
- 1,981
- 1
- 12
- 13