gpt4 book ai didi

azure - 如何在 CosmosDB SqlAPI 中使用破折号查询属性?

转载 作者:行者123 更新时间:2023-12-02 08:25:36 25 4
gpt4 key购买 nike

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

{
"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"

关于azure - 如何在 CosmosDB SqlAPI 中使用破折号查询属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64919801/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com