Azure cosmosdb Azure Cosmos DB包含的语法
我在Azure Cosmos DB上有以下JSON存储Azure cosmosdb Azure Cosmos DB包含的语法,azure-cosmosdb,Azure Cosmosdb,我在Azure Cosmos DB上有以下JSON存储 { "id": "4", "total": 10.46, "tax": 0.55, "soldItems": [ { "item": "CHEESE NIPS 004400001300 F 1.97 D", "price": 1.97 }, { "item": "ROOT BEER 10.46", "price": 10.46 } ] }
{
"id": "4",
"total": 10.46,
"tax": 0.55,
"soldItems": [
{
"item": "CHEESE NIPS 004400001300 F 1.97 D",
"price": 1.97
},
{
"item": "ROOT BEER 10.46",
"price": 10.46
}
]
}
我没有从这个查询中得到任何结果:
SELECT * from c where CONTAINS(c.soldItems.item, "BEER")
检查JSON对象值中的字符串的正确语法是什么?试试以下方法:
SELECT VALUE c FROM c JOIN s in c.soldItems WHERE CONTAINS(s.item, "BEER")
有点混乱,但请注意DocumentDb现在命名为CosmosDb!