EasilyNET.Mongo.ConsoleDebug
4.25.617.153
dotnet add package EasilyNET.Mongo.ConsoleDebug --version 4.25.617.153
NuGet\Install-Package EasilyNET.Mongo.ConsoleDebug -Version 4.25.617.153
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasilyNET.Mongo.ConsoleDebug" Version="4.25.617.153" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasilyNET.Mongo.ConsoleDebug" Version="4.25.617.153" />
<PackageReference Include="EasilyNET.Mongo.ConsoleDebug" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasilyNET.Mongo.ConsoleDebug --version 4.25.617.153
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.Mongo.ConsoleDebug, 4.25.617.153"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=EasilyNET.Mongo.ConsoleDebug&version=4.25.617.153
#tool nuget:?package=EasilyNET.Mongo.ConsoleDebug&version=4.25.617.153
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.Mongo.ConsoleDebug
常使用 EF 的小伙伴就应该能够知道,可以让 EF 生产的 SQL 语句输出到控制台,在开发的时候非常方便调试.<br/> 而 MongoDB 却没有这样的功能,所以产生了这个库,虽然不完美,但是能够解决一些开发过程中不方便排查问题的情况.
- 最终效果类似如下:
╭───────────────────────────────Command─────────────────────────╮╭──────────────────Calendar──────────────────╮
│ { ││ 2023 August │
│ "insert" : "mongo.test", ││ ┌─────┬─────┬─────┬─────┬─────┬─────┬────┐ │
│ "ordered" : true, ││ │ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ S… │ │
│ "$db" : "test1", ││ ├─────┼─────┼─────┼─────┼─────┼─────┼────┤ │
│ "lsid" : { ││ │ │ │ 1 │ 2 │ 3 │ 4 │ 5 │ │
│ "id" : CSUUID("f12dd90d-2f58-4655-9bf2-cbce2d9bd2c4") ││ │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ │
│ }, ││ │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ │
│ "documents" : [{ ││ │ 20 │ 21 │ 22 │ 23* │ 24 │ 25 │ 26 │ │
│ "_id" : ObjectId("64e57f266a1a63e69c52b9cb"), ││ │ 27 │ 28 │ 29 │ 30 │ 31 │ │ │ │
│ "dateTime" : ISODate("2023-08-23T03:38:14.121Z"), ││ │ │ │ │ │ │ │ │ │
│ "timeSpan" : "00:00:50", ││ └─────┴─────┴─────┴─────┴─────┴─────┴────┘ │
│ "dateOnly" : "2023-08-23", │╰────────────────────────────────────────────╯
│ "timeOnly" : "11:38:14", │╭────────────────────Info────────────────────╮
│ "nullableDateOnly" : "2023-08-23", ││ { │
│ "nullableTimeOnly" : null ││ "RequestId": 86, │
│ }] ││ "Timestamp": "2023-08-23 03:38:14", │
│ } ││ "Method": "insert", │
│ ││ "DatabaseName": "test1", │
│ ││ "CollectionName": "mongo.test", │
│ ││ "ConnectionInfo": { │
│ ││ "ClusterId": 1, │
│ ││ "EndPoint": "127.0.0.1:27018" │
│ ││ } │
│ ││ } │
│ │╰────────────────────────────────────────────╯
│ │╭───────────────Request Status───────────────╮
│ ││ ┌───────────┬────────────────┬───────────┐ │
│ ││ │ RequestId │ Time │ Status │ │
│ ││ ├───────────┼────────────────┼───────────┤ │
│ ││ │ 86 │ 11:38:14.12640 │ Succeeded │ │
│ ││ └───────────┴────────────────┴───────────┘ │
│ │╰────────────────────────────────────────────╯
│ │╭───────────────────NiuNiu───────────────────╮
│ ││ -------------------------------------- │
│ ││ / Only two things are infinite, \ │
│ ││ \ the universe and human stupidity. / │
│ ││ -------------------------------------- │
│ ││ ^__^ O ^__^ │
│ ││ _______/(oo) o (oo)\_______ │
│ ││ /\/( /(__) (__)\ )\/\ │
│ ││ ||w----|| ||----w|| │
│ ││ || || || || │
│ ││ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ │
╰───────────────────────────────────────────────────────────────╯╰────────────────────────────────────────────╯
使用方法
- 使用默认值配置
var clientSettings = MongoClientSettings.FromUrl(mongoUrl);
clientSettings.ClusterConfigurator = cb => cb.Subscribe(new ActivityEventConsoleDebugSubscriber());
var mongoClient = new MongoClient(clientSettings);
- 使用集合名称进行过滤
var clientSettings = MongoClientSettings.FromUrl(mongoUrl);
// 定义需要输出的集合
HashSet<string> CommandsWithCollectionName = new()
{
"mongo.test"
};
var options = new InstrumentationOptions()
{
Enable = true,
ShouldStartCollection = coll => CommandsWithCollectionName.Contains(coll)
};
clientSettings.ClusterConfigurator = cb => cb.Subscribe(new ActivityEventConsoleDebugSubscriber(options));
var mongoClient = new MongoClient(clientSettings);
- 添加 MongoDB 诊断信息输出到 OpenTelemetry
// 在上面的基础上,添加如下代码
clientSettings.ClusterConfigurator = cb =>
{
s.Subscribe(new ActivityEventConsoleDebugSubscriber(new()
{
Enable = true
}));
s.Subscribe(new ActivityEventDiagnosticsSubscriber(new()
{
CaptureCommandText = true
}));
};}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- MongoDB.Driver (>= 3.4.0)
- Spectre.Console.Json (>= 0.50.1-preview.0.11)
-
net8.0
- MongoDB.Driver (>= 3.4.0)
- Spectre.Console.Json (>= 0.50.1-preview.0.11)
-
net9.0
- MongoDB.Driver (>= 3.4.0)
- Spectre.Console.Json (>= 0.50.1-preview.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated | |
---|---|---|---|
4.25.617.153 | 113 | 6/17/2025 | |
4.25.616.190 | 112 | 6/16/2025 | |
4.25.616.182 | 106 | 6/16/2025 | |
4.25.613.111 | 252 | 6/13/2025 | |
4.25.609.190 | 427 | 6/9/2025 | |
4.25.609.181 | 379 | 6/9/2025 | |
4.25.609.163 | 380 | 6/9/2025 | |
4.25.609.140 | 370 | 6/9/2025 | |
4.25.605.171 | 299 | 6/5/2025 | |
4.25.605.104 | 304 | 6/5/2025 | |
4.25.602.41 | 306 | 6/1/2025 | |
4.25.526.140 | 317 | 5/26/2025 | |
4.25.513.101 | 405 | 5/13/2025 | |
4.25.506.150 | 318 | 5/6/2025 | |
4.25.429.162 | 323 | 4/29/2025 | |
4.25.429.103 | 349 | 4/29/2025 | |
4.25.411.142 | 319 | 4/11/2025 | |
4.25.409.92 | 327 | 4/9/2025 | |
4.25.403.133 | 326 | 4/3/2025 | |
4.25.319.113 | 324 | 3/19/2025 | |
4.25.312.103 | 332 | 3/12/2025 | |
4.25.227.135 | 279 | 2/27/2025 | |
4.25.221.115 | 274 | 2/21/2025 | |
4.25.212.95 | 277 | 2/12/2025 | |
4.25.211.140 | 277 | 2/11/2025 | |
4.25.124.223 | 266 | 1/24/2025 | |
4.25.116.110 | 263 | 1/16/2025 | |
4.25.115.121 | 236 | 1/15/2025 | |
4.25.114.172 | 252 | 1/14/2025 | |
4.25.109.111 | 258 | 1/9/2025 | |
4.25.108.182 | 259 | 1/8/2025 | |
4.25.108.160 | 265 | 1/8/2025 | |
4.25.1.1 | 284 | 1/1/2025 | |
3.24.1224.141 | 268 | 12/24/2024 | |
3.24.1216.116 | 289 | 12/16/2024 | |
3.24.1206.100 | 270 | 12/6/2024 | |
3.24.1205.171 | 276 | 12/5/2024 | |
3.24.1202.150 | 276 | 12/2/2024 | |
3.24.1126.231 | 274 | 11/26/2024 | |
3.24.1126.172 | 273 | 11/26/2024 | |
3.24.1126.114 | 280 | 11/26/2024 | |
3.24.1126.104 | 274 | 11/26/2024 | |
3.24.1125.181 | 257 | 11/25/2024 | |
3.24.1125.104 | 274 | 11/25/2024 | |
3.24.1121.183 | 263 | 11/21/2024 | |
3.24.1120.183 | 268 | 11/20/2024 | |
3.24.1119.31 | 264 | 11/18/2024 | |
3.24.1115.143 | 258 | 11/15/2024 | |
3.24.1113.100 | 273 | 11/13/2024 | |
3.24.1112.125 | 275 | 11/12/2024 | |
3.24.1107.140 | 272 | 11/7/2024 | |
3.24.1107.54 | 267 | 11/7/2024 | |
3.24.1107.34 | 266 | 11/7/2024 | |
3.24.1105.111 | 266 | 11/5/2024 | |
3.24.1103.31 | 280 | 11/2/2024 | |
3.24.1103 | 276 | 11/2/2024 | |
3.24.1031.135 | 268 | 10/31/2024 | |
3.24.1031.112 | 266 | 10/31/2024 | |
3.24.1031.104 | 266 | 10/31/2024 | |
3.24.1029.142 | 274 | 10/29/2024 | |
3.24.1025.30 | 274 | 10/24/2024 | |
3.24.1022.142 | 261 | 10/22/2024 | |
3.24.1018.204 | 325 | 10/18/2024 | |
3.24.1018.175 | 314 | 10/18/2024 | |
3.24.1018.166 | 315 | 10/18/2024 | |
3.24.1018.93 | 325 | 10/18/2024 | |
3.24.1017.42 | 271 | 10/16/2024 | |
3.24.1016.161 | 273 | 10/16/2024 | |
3.24.1015.231 | 273 | 10/15/2024 | |
3.24.1015.14 | 275 | 10/14/2024 | |
3.24.1012.114 | 273 | 10/12/2024 | |
3.24.1009.115 | 280 | 10/9/2024 | |
3.24.1008.160 | 268 | 10/8/2024 | |
3.24.1008.133 | 279 | 10/8/2024 | |
3.24.1007.185 | 277 | 10/7/2024 | |
3.24.1003.33 | 281 | 10/2/2024 | |
3.24.1002.162 | 273 | 10/2/2024 | |
3.24.929.143 | 274 | 9/29/2024 | |
3.24.929.141 | 278 | 9/29/2024 | |
3.24.929.131 | 274 | 9/29/2024 | |
3.24.929.122 | 281 | 9/29/2024 | |
3.24.926.184 | 273 | 9/26/2024 | |
3.24.926.182 | 272 | 9/26/2024 | |
3.24.926.175 | 279 | 9/26/2024 | |
3.24.924.160 | 270 | 9/24/2024 | |
3.24.924.133 | 284 | 9/24/2024 | |
3.24.924.124 | 274 | 9/24/2024 | |
3.24.924.10 | 278 | 9/23/2024 | |
3.24.924.1 | 275 | 9/23/2024 | |
3.24.923.234 | 270 | 9/23/2024 | |
3.24.923.232 | 269 | 9/23/2024 | |
3.24.923.155 | 277 | 9/23/2024 | |
3.24.919.92 | 287 | 9/19/2024 | |
3.24.914.125 | 291 | 9/14/2024 | |
3.24.914.115 | 274 | 9/14/2024 | |
3.24.914.111 | 272 | 9/14/2024 | |
3.24.911.95 | 277 | 9/11/2024 | |
3.24.908.215 | 266 | 9/8/2024 | |
3.24.904.200 | 271 | 9/4/2024 | |
3.24.828.163 | 279 | 8/28/2024 | |
3.24.820.173 | 289 | 8/20/2024 | |
3.24.814.92 | 289 | 8/14/2024 | |
3.24.812.115 | 288 | 8/12/2024 | |
3.24.802.100 | 261 | 8/2/2024 | |
3.24.801.162 | 272 | 8/1/2024 | |
3.24.801.160 | 267 | 8/1/2024 | |
3.24.801.155 | 268 | 8/1/2024 | |
3.24.730.164 | 265 | 7/30/2024 | |
3.24.730.91 | 257 | 7/30/2024 | |
3.24.724.91 | 263 | 7/24/2024 | |
3.24.718.105 | 282 | 7/18/2024 | |
3.24.716.95 | 292 | 7/16/2024 | |
3.24.712.94 | 272 | 7/12/2024 | |
3.24.710.14 | 276 | 7/9/2024 | |
3.24.709.105 | 272 | 7/9/2024 | |
3.24.704.94 | 275 | 7/4/2024 | |
3.24.701.90 | 284 | 7/1/2024 | |
3.24.628.114 | 281 | 6/28/2024 | |
3.24.627.145 | 272 | 6/27/2024 | |
3.24.620.160 | 280 | 6/20/2024 | |
3.24.613.115 | 275 | 6/13/2024 | |
3.24.612.95 | 278 | 6/12/2024 | |
3.24.528.90 | 270 | 5/28/2024 | |
3.24.522.84 | 285 | 5/22/2024 | |
3.24.512.213 | 279 | 5/12/2024 | |
3.24.508.112 | 285 | 5/8/2024 | |
2.2024.428.71 | 278 | 4/28/2024 | |
2.2.72 | 352 | 4/14/2024 | |
2.2.71 | 276 | 4/12/2024 | |
2.2.6 | 282 | 4/10/2024 | |
2.2.5 | 291 | 3/26/2024 | |
2.2.4 | 290 | 3/25/2024 | |
2.2.3 | 291 | 3/24/2024 | |
2.2.2 | 295 | 3/21/2024 | |
2.2.1 | 289 | 3/20/2024 | |
2.2.0 | 296 | 3/13/2024 | |
2.1.9 | 299 | 2/21/2024 | |
2.1.8 | 303 | 2/18/2024 | |
2.1.7 | 295 | 2/16/2024 | |
2.1.6 | 301 | 2/14/2024 | |
2.1.5 | 299 | 2/14/2024 | |
2.1.4 | 299 | 2/9/2024 | |
2.1.3 | 297 | 2/8/2024 | |
2.1.2 | 298 | 2/5/2024 | |
2.1.1.2 | 356 | 12/26/2023 | |
2.1.1.1 | 298 | 12/26/2023 | |
2.1.1 | 299 | 12/25/2023 | |
2.1.0 | 320 | 12/17/2023 | |
2.0.11 | 305 | 12/6/2023 | |
2.0.1 | 303 | 11/15/2023 | |
2.0.0 | 282 | 11/14/2023 | |
1.9.1 | 306 | 11/1/2023 | |
1.9.0 | 295 | 10/19/2023 | |
1.9.0-preview2 | 285 | 10/12/2023 | |
1.9.0-preview1 | 271 | 10/12/2023 | |
1.8.9 | 305 | 10/11/2023 | |
1.8.8 | 301 | 10/11/2023 | |
1.8.7-rc2 | 278 | 9/21/2023 | |
1.8.7-rc1 | 281 | 9/12/2023 | |
1.8.6 | 325 | 8/31/2023 | |
1.8.5 | 303 | 8/25/2023 | |
1.8.4 | 304 | 8/24/2023 | |
1.8.3 | 307 | 8/23/2023 | |
1.8.2 | 373 | 8/22/2023 | |
1.8.1 | 298 | 8/18/2023 |