Give the following documents stored in Cosmos DB, how do I go about getting all of the Child/Children elements where the FirstName field of each child is "Bob"? I'm trying to use the SQL query syntax, but have not found the right way to do this that combines both document schema results.
// Document 1
{
"id": "document1",
"Child": {
"FirstName": "Bob",
"LastName": "Smith"
}
}
// Document 2
{
"id": "document2",
"Children": [
{
"Name": "Bob",
"LastName": "Jones"
},
{
"Name": "Sue",
"LastName": "Jones"
}
]
}
I'm trying to write a query that looks for all "Bob" child elements to achieve the following output:
[
{
"FirstName": "Bob",
"LastName": "Smith"
},
{
"Name": "Bob",
"LastName": "Jones"
},
]