Reputation: 17383
I've a document structure below (simplified):
{
"id": "2345",
"camp{
"id": 999
"code": "C1244
"offers": [
{
"status": "active",
"description": "Commence Loyalty At Year 6"
},
{
"status": "inactive"
"description": "abcd test
}
}
}
Where I would like to filter the offers where status is active. Can someone help me with what the query may look like for this?
Upvotes: 0
Views: 82
Reputation: 8690
Please try something like this sql:
SELECT c.camp.id,c.camp.code,d AS offer FROM c join d in c.camp.offers where d.status = 'active'
Here is the result:
[
{
"id": 999,
"code": "C1244",
"offer": {
"status": "active",
"description": "Commence Loyalty At Year 6"
}
}
]
Hope this can help you:).
Upvotes: 1