【发布时间】:2020-08-28 12:11:27
【问题描述】:
我无法使用 AspNetCore.HealthChecks.MongoDb nuget 包在 dot net core 3.1 中添加 Mongo Atlas 健康检查。将以下代码添加到 startup.cs 中
services.AddHealthChecks().AddMongoDb("MongoDbContext");
endpoints.MapHealthChecks("/api/v1.0/health", new HealthCheckOptions()
当我点击健康 URL 时,它给出了如下异常
"Status": "Unhealthy",
"Description": null,
"Exception": "MongoDB.Driver.MongoCommandException: Command listCollections failed: not authorized on test to execute command
【问题讨论】:
标签: c# mongodb .net-core mongodb-atlas health-check