![]() |
VOOZH | about |
dotnet add package AspNetCore.HealthChecks.MongoDb --version 9.0.0
NuGet\Install-Package AspNetCore.HealthChecks.MongoDb -Version 9.0.0
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="9.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.MongoDb" Version="9.0.0" />Directory.Packages.props
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" />Project file
paket add AspNetCore.HealthChecks.MongoDb --version 9.0.0
#r "nuget: AspNetCore.HealthChecks.MongoDb, 9.0.0"
#:package AspNetCore.HealthChecks.MongoDb@9.0.0
#addin nuget:?package=AspNetCore.HealthChecks.MongoDb&version=9.0.0Install as a Cake Addin
#tool nuget:?package=AspNetCore.HealthChecks.MongoDb&version=9.0.0Install as a Cake Tool
This health check verifies the ability to communicate with MongoDB. It uses the provided MongoClient to list database names or ping configured database.
By default, the MongoClient instance is resolved from service provider.
void Configure(IHealthChecksBuilder builder)
{
builder.Services
.AddSingleton(sp => new MongoClient("mongodb://localhost:27017"))
.AddHealthChecks()
.AddMongoDb();
}
You can additionally add the following parameters:
clientFactory: A factory method to provide MongoClient instance.databaseNameFactory: A factory method to provide database name.name: The health check name. The default is mongodb.failureStatus: The HealthStatus that should be reported when the health check fails. Default is HealthStatus.Unhealthy.tags: A list of tags that can be used to filter sets of health checks.timeout: A System.TimeSpan representing the timeout of the check.void Configure(IHealthChecksBuilder builder)
{
builder.Services
.AddSingleton(sp => new MongoClient("mongodb://localhost:27017"))
.AddHealthChecks()
.AddMongoDb(databaseNameFactory: sp => "theName");
}
MongoDbHealthCheck was letting the users specify how MongoClient should be created (from raw connection string or from MongoUrl or from MongoClientSettings), at a cost of maintaining an internal, static client instances cache. Now the type does not create client instances nor maintain an internal cache and it's the caller responsibility to provide the instance of MongoClient (please see #2048 for more details). Since MongoDB recommends treating clients as singletons and client instances can be expensive to create, it's recommended to register a singleton factory method for MongoClient. So the client is created only when needed and once per whole application lifetime.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on AspNetCore.HealthChecks.MongoDb:
| Package | Downloads |
|---|---|
|
Reo.Core.NoSql
Package Description |
|
|
Reo.Core.AutoHistory
Package Description |
|
|
Reo.Core.Testing
Package Description |
|
|
Reo.Core.Email
Package Description |
|
|
Reo.Core.IntegrationTesting
Package Description |
Showing the top 20 popular GitHub repositories that depend on AspNetCore.HealthChecks.MongoDb:
| Repository | Stars |
|---|---|
|
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
|
|
|
dotnetcore/osharp
OSharp是一个基于.Net6.0的快速开发框架,框架对 AspNetCore 的配置、依赖注入、日志、缓存、实体框架、Mvc(WebApi)、身份认证、功能权限、数据权限等模块进行更高一级的自动化封装,并规范了一套业务实现的代码结构与操作流程,使 .Net 框架更易于应用到实际项目开发中。
|
|
|
grandnode/grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
|
|
|
featbit/featbit
Enterprise-grade feature flag platform that you can self-host. Get started - free.
|
|
|
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 10.
|
|
|
Meowv/Blog
🤣本项目有不同开发版本,最新版底层基于 abp vNext 搭建和免费开源跨平台框架 .NET5 进行开发,使用 MongoDB 存储数据,Redis 缓存数据。项目采用前后端分离的模式进行开发,API 遵循 RESTful 接口规范,页面使用 Blazor 进行开发,可作为 .NET Core 入门项目进行学习。If you liked `Blog` project or if it helped you, please give a star ⭐️ for this repository. 👍👍👍
|
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 9, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
streetwriters/notesnook-sync-server
Sync server for Notesnook (self-hosting in alpha)
|
|
|
Aguafrommars/TheIdServer
OpenID/Connect, OAuth2, WS-Federation and SAML 2.0 server based on Duende IdentityServer and ITFoxtec Identity SAML 2.0 with its admin UI
|
|
|
jeangatto/ASP.NET-Core-Clean-Architecture-CQRS-Event-Sourcing
ASP.NET Core, C#, CQRS Event Sourcing, REST API, DDD, SOLID Principles and Clean Architecture
|
|
|
meysamhadeli/booking-modular-monolith
A practical Modular Monolith architecture with the latest technologies and architecture like Vertical Slice Architecture, Event Driven Architecture, CQRS, DDD, gRpc, Masstransit, and Aspire in .Net 10.
|
|
|
fals/cqrs-clean-eventual-consistency
CQRS, using Clean Architecture, multiple databases and Eventual Consistency
|
|
|
mehdihadeli/food-delivery-modular-monolith
🌭 A practical and imaginary food and grocery delivery modular monolith, built with .Net 8, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
| ElectNewt/Distribt | |
|
Anapher/Strive
Open source video conferencing platform
|
|
|
vany0114/microservices-dotnetcore-docker-sf-k8s
Shows an approach to work with a microservices based architecture using .Net Core, Docker, and Azure Service Fabric/Kubernetes, applying Domain Driven Design (DDD) and Comand and Query Responsibility Segregation (CQRS) and other patterns.
|
|
|
alperenkucukali/dotnet-microservices
This project is a sample of microservices architecture with .NET 8.
|
|
|
aelassas/microservices
Microservices sample architecture using ASP.NET Core, Ocelot, MongoDB and JWT
|
|
|
kamilbaczek/Modular-monolith-by-example
Modular monolith architecture example in .NET. Estimation Tool is tool to optimize estimation process in IT company.
|
|
|
Genocs/clean-architecture-template
The Clean Architecture Template built on top of .NET 10
|
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 5,327,735 | 12/19/2024 |
| 8.1.0 | 2,765,645 | 8/28/2024 |
| 8.0.1 | 2,827,680 | 4/2/2024 |
| 8.0.0 | 1,463,963 | 12/15/2023 |
| 7.0.0 | 1,443,667 | 7/30/2023 |
| 7.0.0-rc2.6 | 46,123 | 3/13/2023 |
| 7.0.0-rc2.5 | 42,844 | 1/14/2023 |
| 7.0.0-rc2.4 | 979 | 12/27/2022 |
| 7.0.0-rc2.3 | 2,791 | 12/27/2022 |
| 6.0.2 | 8,823,273 | 2/28/2022 |
| 6.0.1 | 1,206,542 | 12/29/2021 |
| 6.0.1-rc2.2 | 26,376 | 11/10/2021 |
| 6.0.1-rc1.1 | 858 | 11/5/2021 |
| 6.0.0 | 65,486 | 12/29/2021 |
| 5.0.1 | 2,709,747 | 1/5/2021 |
| 5.0.0 | 63,892 | 12/29/2020 |
| 5.0.0-preview1 | 2,762 | 11/22/2020 |
| 3.1.3 | 1,693,475 | 10/22/2020 |
| 3.1.2 | 984,752 | 6/26/2020 |
| 3.1.1 | 478,841 | 4/17/2020 |