In an Azure Cosmos container are saved examination items and each examination may have nested examinations. (see JSON example below).
How can I query all examinations for a given patient using Cosmos Client, returning all examinations in a flat hierarchy?
For the given example, the returned objects should be like:
Exam#1
Exam#2
Exam#3
For clarification: The equivalent in a relational database has an examination table where I will query patient examinations using 'SELECT * from examinations WHERE (patient = Patient#1)'
{
"patient": {
"$id": "1",
"Name": "Patient#1",
"id": "Exam#1"
},
"examinations": [
{
"patient": {
"$ref": "1"
},
"examinations": [],
"id": "Exam#2"
},
{
"patient": {
"$ref": "1"
},
"id": "Exam#3"
}
],
}