我的文档结构如下(简化):
{
"id": "2345",
"camp{
"id": 999
"code": "C1244
"offers": [
{
"status": "active",
"description": "Commence Loyalty At Year 6"
},
{
"status": "inactive"
"description": "abcd test
}
}
}
我想在其中筛选状态为“活动”的报价。有人能帮我看看这个查询是什么样子的吗?
请尝试如下 sql:
SELECT c.camp.id,c.camp.code,d AS offer FROM c join d in c.camp.offers where d.status = 'active'
结果如下:
[
{
"id": 999,
"code": "C1244",
"offer": {
"status": "active",
"description": "Commence Loyalty At Year 6"
}
}
]
希望这能帮到你:)。