使用 Mongodb 和逻辑应用程序插入文档时出现问题
Problems inserting document with Mongodb and Logic Apps
我的逻辑应用程序从 api rest 收集数据并插入 cosmosdb mongodb。该过程成功进行,但在使用数据资源管理器执行查询时出现以下错误:
Error while fetching page of documents: {"code":400,"body":"Command find failed: Unknown server error occurred when processing this request."}
这是重现错误的调用示例:
"Create_or_update_document": {
"inputs": {
"body": {
"id": "11111",
"name": "john",
"surname": "doe"
},
"host": {
"connection": {
"name": "@parameters('$connections')['documentdb']['connectionId']"
}
},
"method": "post",
"path": "/dbs/@{encodeURIComponent('cockpit')}/colls/@{encodeURIComponent('target-collection')}/docs"
},
"runAfter": {
"HTTP_2": [
"Succeeded"
]
},
"type": "ApiConnection"
}
示例输入:
{
"id": "11111",
"name": "john",
"surname": "doe"
}
我一直在探索的是与创建 ObjectId 相关的内容。有人知道解决方案吗?
基于 Connectors for Azure Logic Apps document,you could find the ~200+ connectors list.
然后导航到 Azure Cosmos DB Connector,您可以看到语句:
To use this integration, you will need a Cosmos DB SQL API account
configured in the Azure Portal. Note that Mongo DB API accounts are
not currently supported.
您现在无法将 Azure Cosmos DB 逻辑应用程序连接器与 MongoDB API 一起使用。它目前在后台使用 SQL REST API。
我建议您创建一个简单的 Azure 函数,该函数可以使用您选择的语言从 MongoDB 驱动程序中为您插入,然后从逻辑应用程序中调用该函数。
我的逻辑应用程序从 api rest 收集数据并插入 cosmosdb mongodb。该过程成功进行,但在使用数据资源管理器执行查询时出现以下错误:
Error while fetching page of documents: {"code":400,"body":"Command find failed: Unknown server error occurred when processing this request."}
这是重现错误的调用示例:
"Create_or_update_document": {
"inputs": {
"body": {
"id": "11111",
"name": "john",
"surname": "doe"
},
"host": {
"connection": {
"name": "@parameters('$connections')['documentdb']['connectionId']"
}
},
"method": "post",
"path": "/dbs/@{encodeURIComponent('cockpit')}/colls/@{encodeURIComponent('target-collection')}/docs"
},
"runAfter": {
"HTTP_2": [
"Succeeded"
]
},
"type": "ApiConnection"
}
示例输入:
{
"id": "11111",
"name": "john",
"surname": "doe"
}
我一直在探索的是与创建 ObjectId 相关的内容。有人知道解决方案吗?
基于 Connectors for Azure Logic Apps document,you could find the ~200+ connectors list.
然后导航到 Azure Cosmos DB Connector,您可以看到语句:
To use this integration, you will need a Cosmos DB SQL API account configured in the Azure Portal. Note that Mongo DB API accounts are not currently supported.
您现在无法将 Azure Cosmos DB 逻辑应用程序连接器与 MongoDB API 一起使用。它目前在后台使用 SQL REST API。
我建议您创建一个简单的 Azure 函数,该函数可以使用您选择的语言从 MongoDB 驱动程序中为您插入,然后从逻辑应用程序中调用该函数。