如何在 CosmosDB SqlAPI 中查询带有破折号的 属性?

How to query a property with a dash in CosmosDB SqlAPI?

查询:我想获取所有三月份出生的人的记录列表。

{
    "details": {
        "state": "CA",
        "city": "San Fransisco",
        "date-of-birth": { // there is a "-" in the key
            "month": "March",
            "year": "2000"
        }
    },
    "personId": "person1",
    "id": "id1"
},
{
    "details": {
        "state": "CA",
        "city": "San Jose",
        "date-of-birth": { // there is a "-" in the key
            "month": "April",
            "year": "2000"
        }
    },
    "personId": "person2"
    "id": "id2"
}

我希望 SQL 查询是这样的,但出现错误:

select * from c where c.details['date-of-birth'['month']] = "March"

有人可以帮我解答一下吗?我确实尝试查看文档,但有点困惑。

试试这个

select * from c where c.details['date-of-birth'].month = "March"