![](/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.