【问题标题】:CosmosDB connector / Delete a document in a partitioned collection / wrong header attribute used by the DesignerCosmosDB 连接器/删除分区集合中的文档/设计器使用的错误标头属性
【发布时间】:2019-03-03 09:48:05
【问题描述】:

使用逻辑应用 CosmosDB 连接器/操作“删除文档”,生成的逻辑应用代码使用标头属性

x-ms-documentdb-raw-partitionkey

这会导致错误(无效的分区键)。

当手动更正标题属性名称时

x-ms-documentdb-partitionkey

一切正常。

其他有类似经历的人吗?

谢谢。

【问题讨论】:

    标签: azure-logic-apps


    【解决方案1】:

    x-ms-documentdb-raw-partitionkey 对我来说效果很好。以下是我的洛杉矶工作流程:

            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "For_each": {
                    "actions": {
                        "Delete_a_document": {
                            "inputs": {
                                "headers": {
                                    "x-ms-documentdb-raw-partitionkey": "\"abc\""
                                },
                                "host": {
                                    "connection": {
                                        "name": "@parameters('$connections')['documentdb']['connectionId']"
                                    }
                                },
                                "method": "delete",
                                "path": "/dbs/@{encodeURIComponent('test')}/colls/@{encodeURIComponent('test')}/docs/@{encodeURIComponent(items('For_each')?['id'])}"
                            },
                            "runAfter": {},
                            "type": "ApiConnection"
                        }
                    },
                    "foreach": "@body('Get_all_documents')?['Documents']",
                    "runAfter": {
                        "Get_all_documents": [
                            "Succeeded"
                        ]
                    },
                    "type": "Foreach"
                },
                "Get_all_documents": {
                    "inputs": {
                        "headers": {
                            "x-ms-documentdb-raw-partitionkey": "\"abc\""
                        },
                        "host": {
                            "connection": {
                                "name": "@parameters('$connections')['documentdb']['connectionId']"
                            }
                        },
                        "method": "get",
                        "path": "/dbs/@{encodeURIComponent('test')}/colls/@{encodeURIComponent('test')}/docs"
                    },
                    "runAfter": {},
                    "type": "ApiConnection"
                }
            },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-23
      • 2019-08-05
      • 2018-04-27
      相关资源
      最近更新 更多