I am new to Azure Cosmos DB and I'm trying to create a stored procedure using SQLAPI to return data.
Using the following as an example:
{
"id":"123",
"fname" : "John",
"lname" : "Doe",
"receivedTime" : "08/08/2019 09:54:57",
"subjects" : [
{
"subjectid" : "01",
"subjectname" : "English"
"subjectmark" : "80"
},
{
"subjectid" : "02",
"subjectname" : "Math"
"subjectmark" : "70"
}
]
}
How would I build a stored procedure to return the root data as well as the average of the subjectmarks?