Reputation: 9000
I have the entries in my CosmosDB that following this structure:
{
"id": "~results:123",
"catalog:entity": [
{
"id": "~song.base:1da",
"schema:name": "Autobiography",
"schema:code": [
"7dhs"
]
},
{
"id": "~song.base:2da",
"schema:name": "Autobiography",
"schema:code": [
"4lko"
]
}
]
}
However I'm having issues in getting searching for those that contain a specific schema:code:
that in exists in an array with a parent array catalog:entity
.
I've tried a handful of things such as with no luck:
SELECT * FROM c JOIN schema:code IN c["catalog:entity"] WHERE schema:code IN "7dhs"
SELECT *' is only valid with a single input set.
Any ideas would be appreciated.
Thanks
Upvotes: 1
Views: 67
Reputation: 23792
Use sql:
SELECT c FROM c
JOIN s IN c["catalog:entity"]
where array_contains(s["schema:code"],"7dhs",false)
Output:
Upvotes: 1