![](/img/trans.png)
[英]MongoNotConnectedError: MongoClient must be connected to perform this operation. How to handle this error?
[英]Function was unable to start. Microsoft.Azure.DocumentDB.Core: PartitionKey value must be supplied for this operation.?
我有一个简单的 azure 函数 Cosmos 触发器设置,如下所示:
{
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "documents",
"direction": "in",
"leaseCollectionName": "leases",
"connectionStringSetting": "DbConnectionString",
"databaseName": "mydb",
"collectionName": "mycollection",
"createLeaseCollectionIfNotExists": "true"
}
],
"scriptFile": "../dist/TestCosmosTrigger/index.js"
}
当我运行该函数时,出现错误:
函数“Functions.FeedNotifier”的侦听器无法启动。 Microsoft.Azure.Documents.ChangeFeedProcessor:主机已初始化。
我确实尝试将 partitionKey 字段添加到 ebindings 无济于事。
请更新到最新的Microsoft.Azure.WebJobs.Extensions.CosmosDB
依赖包。
此错误要么意味着您有一个未按/id
分区的分区租约集合,要么您使用的是旧的扩展版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.