小编Ami*_*ima的帖子

PYTHON - 从 Azure Cosmos DB 中的集合中删除项目

我是使用 Azure 进行开发的新手。我希望你能帮助解决这个代码。我的目标是从 Azure Cosmos DB 的集合中删除项目。但我收到 http 错误:如果我使用此值 'partionKey' = '/Structures',则为 400;如果值为 '',则为 404。错误消息 =“x-ms-partitionkey 标头中提供的分区键的组件少于集合中定义的组件”

client = cosmos_client.CosmosClient("https://....documents.azure.com:443/", {'masterKey': '...'})

options = {}

options['enableCrossPartitionQuery'] = True
options['maxItemCount'] = 5
options['partitionKey'] = '/Structures'

client.DeleteItem("dbs/.../colls/.../docs/.../", options)
Run Code Online (Sandbox Code Playgroud)

python-2.7 azure-cosmosdb

3
推荐指数
1
解决办法
4914
查看次数

标签 统计

azure-cosmosdb ×1

python-2.7 ×1