EasilyNET.Mongo.ConsoleDebug
1.6.6
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasilyNET.Mongo.ConsoleDebug --version 1.6.6
NuGet\Install-Package EasilyNET.Mongo.ConsoleDebug -Version 1.6.6
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="1.6.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.Mongo.ConsoleDebug --version 1.6.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.Mongo.ConsoleDebug, 1.6.6"
#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.
// Install EasilyNET.Mongo.ConsoleDebug as a Cake Addin #addin nuget:?package=EasilyNET.Mongo.ConsoleDebug&version=1.6.6 // Install EasilyNET.Mongo.ConsoleDebug as a Cake Tool #tool nuget:?package=EasilyNET.Mongo.ConsoleDebug&version=1.6.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.Mongo.ConsoleDebug
常使用 EF 的小伙伴就应该能够知道,可以让 EF 生产的 SQL 语句输出到控制台,在开发的时候非常方便调试.而 MongoDB 却没有这样的功能,所以产生了这个库,虽然不完美,但是能够解决一些开发过程中不方便排查问题的情况.
- 最终效果类似如下:
[16:05:26 INF] MongoRequest: 12,Command:
{
"find" : "mongo.test2",
"filter" : {
"_id" : "c7c5d0f8-b57d-4901-913d-8a5cfacf1286"
},
"limit" : 2,
"$db" : "hoyo",
"lsid" : {
"id" : CSUUID("498de1a4-a352-40f2-9634-d49627f609aa")
}
}
[16:05:26 INF] MongoRequest: 12,Status: Succeeded
对命令文本进行简要的分析,因为不同的命令会产生不同的结构.
名称 含义 find 表示该命令为查询命令,他的值就是查询的集合名称 filter 表示查询条件 limit 表示查询的数据量 $db 表示执行该命令的数据库 可以看到命令文本前加了 MongoRequest 表示请求 ID,同时后边显示了该请求的成功状态. Succeeded 表示执行成功,Failed 表示执行失败.
使用方法
- 使用默认值配置
var clientSettings = MongoClientSettings.FromUrl(mongoUrl);
clientSettings.ClusterConfigurator = cb => cb.Subscribe(new ActivityEventSubscriber());
var mongoClient = new MongoClient(clientSettings);
- 使用集合名称进行过滤
var clientSettings = MongoClientSettings.FromUrl(mongoUrl);
var options = new InstrumentationOptions { ShouldStartActivity = @event => !"collectionToIgnore".Equals(@event.GetCollectionName()) };
clientSettings.ClusterConfigurator = cb => cb.Subscribe(new DiagnosticsActivityEventSubscriber(options));
var mongoClient = new MongoClient(clientSettings);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- MongoDB.Driver.Core (>= 2.20.0)
-
net7.0
- MongoDB.Driver.Core (>= 2.20.0)
-
net8.0
- MongoDB.Driver.Core (>= 2.20.0)
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 |
---|---|---|
3.24.710.14 | 32 | 7/9/2024 |
3.24.709.105 | 30 | 7/9/2024 |
3.24.704.94 | 38 | 7/4/2024 |
3.24.701.90 | 37 | 7/1/2024 |
3.24.628.114 | 48 | 6/28/2024 |
3.24.627.145 | 36 | 6/27/2024 |
3.24.620.160 | 45 | 6/20/2024 |
3.24.613.115 | 41 | 6/13/2024 |
3.24.612.95 | 39 | 6/12/2024 |
3.24.528.90 | 44 | 5/28/2024 |
3.24.522.84 | 53 | 5/22/2024 |
3.24.512.213 | 52 | 5/12/2024 |
3.24.508.112 | 53 | 5/8/2024 |
2.2024.428.71 | 50 | 4/28/2024 |
2.2024.427.1128 | 84 | 4/27/2024 |
2.2.72 | 126 | 4/14/2024 |
2.2.71 | 47 | 4/12/2024 |
2.2.8 | 73 | 4/26/2024 |
2.2.6 | 48 | 4/10/2024 |
2.2.5 | 63 | 3/26/2024 |
2.2.4 | 61 | 3/25/2024 |
2.2.3 | 60 | 3/24/2024 |
2.2.2 | 61 | 3/21/2024 |
2.2.1 | 60 | 3/20/2024 |
2.2.0 | 63 | 3/13/2024 |
2.1.9 | 66 | 2/21/2024 |
2.1.8 | 71 | 2/18/2024 |
2.1.7 | 58 | 2/16/2024 |
2.1.6 | 65 | 2/14/2024 |
2.1.5 | 63 | 2/14/2024 |
2.1.4 | 63 | 2/9/2024 |
2.1.3 | 69 | 2/8/2024 |
2.1.2 | 59 | 2/5/2024 |
2.1.1.2 | 124 | 12/26/2023 |
2.1.1.1 | 67 | 12/26/2023 |
2.1.1 | 70 | 12/25/2023 |
2.1.0 | 87 | 12/17/2023 |
2.0.11 | 85 | 12/6/2023 |
2.0.1 | 87 | 11/15/2023 |
2.0.0 | 69 | 11/14/2023 |
1.9.1 | 89 | 11/1/2023 |
1.9.0 | 70 | 10/19/2023 |
1.9.0-preview2 | 70 | 10/12/2023 |
1.9.0-preview1 | 58 | 10/12/2023 |
1.8.9 | 77 | 10/11/2023 |
1.8.8 | 77 | 10/11/2023 |
1.8.7-rc2 | 67 | 9/21/2023 |
1.8.7-rc1 | 69 | 9/12/2023 |
1.8.6 | 106 | 8/31/2023 |
1.8.5 | 74 | 8/25/2023 |
1.8.4 | 80 | 8/24/2023 |
1.8.3 | 85 | 8/23/2023 |
1.8.2 | 144 | 8/22/2023 |
1.8.1 | 81 | 8/18/2023 |
1.8.0 | 557 | 8/15/2023 |
1.7.9 | 544 | 8/11/2023 |
1.7.8 | 518 | 8/11/2023 |
1.7.7 | 549 | 8/10/2023 |
1.7.6 | 601 | 8/9/2023 |
1.7.5 | 506 | 8/9/2023 |
1.7.4 | 622 | 8/3/2023 |
1.7.3 | 570 | 8/1/2023 |
1.7.2 | 613 | 7/31/2023 |
1.7.1 | 582 | 7/27/2023 |
1.7.0 | 581 | 7/25/2023 |
1.6.9 | 593 | 7/25/2023 |
1.6.8 | 608 | 7/24/2023 |
1.6.7 | 634 | 7/20/2023 |
1.6.6 | 641 | 7/19/2023 |
1.6.5 | 516 | 7/19/2023 |
1.6.4 | 600 | 7/17/2023 |
1.6.3 | 567 | 7/17/2023 |
1.6.2 | 627 | 7/12/2023 |
1.6.1 | 637 | 6/30/2023 |
1.6.0 | 591 | 6/26/2023 |
1.5.9 | 631 | 6/22/2023 |
1.5.8 | 600 | 6/15/2023 |
1.5.7.1 | 583 | 6/14/2023 |
1.5.7 | 596 | 6/14/2023 |
1.5.6.2 | 624 | 6/7/2023 |
1.5.6.1 | 602 | 6/7/2023 |
1.5.6 | 648 | 6/7/2023 |
1.5.5.2 | 566 | 5/26/2023 |
1.5.5.1 | 612 | 5/26/2023 |
1.5.5 | 644 | 5/26/2023 |
1.5.4.4 | 664 | 5/25/2023 |
1.5.4.3 | 627 | 5/23/2023 |
1.5.4.2 | 730 | 5/17/2023 |
1.5.4.1 | 641 | 5/16/2023 |
1.5.4 | 690 | 5/11/2023 |
1.5.3 | 629 | 5/11/2023 |
1.5.2 | 634 | 5/10/2023 |
1.5.1 | 595 | 5/10/2023 |
1.5.0 | 679 | 5/6/2023 |
1.4.0 | 671 | 5/5/2023 |
1.3.9 | 689 | 4/23/2023 |
1.3.8.6 | 682 | 4/23/2023 |
1.3.8.5 | 584 | 4/21/2023 |
1.3.8.1 | 702 | 4/12/2023 |
1.3.8 | 698 | 4/11/2023 |
1.3.7 | 670 | 4/9/2023 |
1.3.6.3 | 751 | 4/1/2023 |
1.3.6.2 | 677 | 3/31/2023 |
1.3.6.1 | 713 | 3/31/2023 |
1.3.6 | 704 | 3/31/2023 |
1.3.5 | 686 | 3/30/2023 |
1.3.4.1 | 775 | 3/29/2023 |
1.3.4 | 643 | 3/28/2023 |
1.3.3 | 621 | 3/28/2023 |
1.3.2 | 746 | 3/26/2023 |
1.3.1 | 826 | 3/22/2023 |
1.3.0 | 724 | 3/21/2023 |
1.2.0 | 644 | 3/21/2023 |
1.1.0 | 704 | 3/17/2023 |
1.0.9 | 668 | 3/15/2023 |
1.0.8 | 673 | 3/15/2023 |
1.0.7 | 662 | 3/15/2023 |
1.0.6 | 706 | 3/13/2023 |
1.0.5 | 750 | 3/13/2023 |
1.0.4 | 705 | 3/13/2023 |
1.0.2 | 763 | 2/26/2023 |
1.0.1 | 729 | 2/23/2023 |
1.0.0 | 708 | 2/20/2023 |