英文:
Not able to upload data to cosmos using Azure UI
问题
我想将数据上传到Cosmos DB(NoSQL API)。以下是我对表的分区键逻辑:
分区键:/x_id/location/name
唯一键:[/source, /type]
我要上传的JSON文件如下:
[
{
"x_id": "1",
"type": "ROLL",
"location": "10",
"source": "A",
"event_name": "B"
},
{
"x_id": "2",
"type": "ROLL",
"location": "11",
"source": "C",
"event_name": "D"
}
]
保存数据时出现以下错误:
Error bulk creating items for container table_name:
不能使用 'in' 运算符在 1 中搜索 'location'
但是,当我将单个项目添加到相同的容器时,一切正常,但进行批量上传时开始出现上述错误。
有人可以帮忙解决这个问题吗?
英文:
I want to upload the data to cosmos DB (NoSQL API).
Here is my Partition key logic for the Table
partition key : /x_id/location/name
unique keys : [/source, /type]
The JSON file I want to upload is
[
{
"x_id": "1",
"type": "ROLL",
"location": "10",
"source": "A",
"event_name": "B"
},
{
"x_id": "2",
"type": "ROLL",
"location": "11",
"source": "C",
"event_name": "D"
}
]
It's giving me the below error for saving the data
Error bulk creating items for container table_name:
Cannot use the 'in' operator to search for 'location' in 1
But when I add single items to the same container it's working fine, but when doing bulk upload it starts giving the above error.
Option used for bulk upload : Upload Item
Can anyone help with this?
答案1
得分: 1
- 为了在 Cosmos DB 中创建分层分区键,
/x_id/location/name
点击添加分层分区键
以按顺序添加每个键。由于示例文档中没有名为name
的列,我将其替换为event_name
。
- 在上图中创建分区键后,项目被成功上传,没有出现任何错误。
英文:
- In order to create hierarchical partition key in cosmos db,
/x_id/location/name
clickAdd hierarchical partition key
for adding each key in order. Since there is no column namedname
in the sample document shared, I replaced that withevent_name
.
- After creating partition key as in above image, items got uploaded without any error.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论