Azure cosmosdb 如何一次检查两个以上的id
我一直在创建一个类似blow json模式的目录服务 Json模式:Azure cosmosdb 如何一次检查两个以上的id,azure-cosmosdb,Azure Cosmosdb,我一直在创建一个类似blow json模式的目录服务 Json模式: { "id": "b01ee924-78d3-4f3a-9568-5ee80cbad7a7", "VendorName": "string", "Industy": [ { "Id": "0350ac6c-ca15-4a1e-9211-ad078fbf443c", "IdustryId": 0, "IdustryNa
{
"id": "b01ee924-78d3-4f3a-9568-5ee80cbad7a7",
"VendorName": "string",
"Industy": [
{
"Id": "0350ac6c-ca15-4a1e-9211-ad078fbf443c",
"IdustryId": 0,
"IdustryName": "string",
"Category": [
{
"id": "a7b71770-9daf-4b67-b471-0a8390843544",
"Name": "string",
"Description": "string",
"Subcategory": [
{
"id": "76a6ead4-9f4d-4d6e-9c30-70938f088ea3",
"Name": "string",
"Description": "string",
"Product": [
{
"Id": "abf95277-ccbc-4f9d-aeda-b6cc9c99953b",
"Name": "string",
"CurrentQuantity": 0,
"Tag": "string",
"Unit": "string",
"Price": 0,
"hasMethodOfPreparation": true,
"MethodOfPreparation": [
{
"id": "a78cb9ea-276f-494b-840a-6eab5e7d8f4b",
"Description": "string",
"Price": 0
}
],
"Addons": [
{
"id": "bdf97be3-5dd1-49e9-bdec-7ac0d3288adb",
"Description": "one",
"Price": 0
},
{
"id": "8f03d2e2-be1f-446d-b943-be9b8fe8ec4c",
"Description": "new add",
"Price": 0
我像blow一样查询数据
查询:
实际结果:对于特定的供应商、行业、类别、子类别,我需要获取并创建产品。
注:此处有多个行业、类别、子类别
{
"Id": "abf95277-ccbc-4f9d-aeda-b6cc9c99953b",
"Name": "string",
"CurrentQuantity": 0,
"Tag": "string",
"Unit": "string",
"Price": 0,
"hasMethodOfPreparation": true,
"MethodOfPreparation": [
{
"id": "a78cb9ea-276f-494b-840a-6eab5e7d8f4b",
"Description": "string",
"Price": 0
}
但我需要检查行业id、类别id和子类别id。
怎么做,,
请给我提个建议。提前感谢。请使用sql:
SELECT product FROM c
join industry in c.Industy
join category in industry.Category
join Subcategory in category.Subcategory
join product in Subcategory.Product
where industry.Id ='<your item id>'
and category.Id = '<your item id>'
and Subcategory.Id = '<your item id>'
从c中选择产品
加入c行业
加入行业类别。类别
在类别中联接子类别。子类别
将产品加入子类别。产品
其中industry.Id=“”
和category.Id=''
和子类别。Id=“”
输出:
我使用的是CosmosDBW,您需要检查行业id、类别id和子类别id是什么意思?你是说你想问他们?或者过滤它们?您的样本数据不完整,请填写并提供有关您需求的更多详细信息。我需要获取特定供应商、行业、类别和子类别的产品。有多个供应商、行业、,类别或子类别那么过滤条件是什么?或者请列出您想要的结果格式?我试图生成sql…过滤条件应该检查行业、类别、子类别id
SELECT product FROM c
join industry in c.Industy
join category in industry.Category
join Subcategory in category.Subcategory
join product in Subcategory.Product
where industry.Id ='<your item id>'
and category.Id = '<your item id>'
and Subcategory.Id = '<your item id>'