StarMongoDbHelper 23.8.30
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Core 2.0
This package targets .NET Core 2.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.1
This package targets .NET Framework 4.6.1. The package is compatible with this framework or higher.
dotnet add package StarMongoDbHelper --version 23.8.30
NuGet\Install-Package StarMongoDbHelper -Version 23.8.30
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="StarMongoDbHelper" Version="23.8.30" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StarMongoDbHelper --version 23.8.30
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StarMongoDbHelper, 23.8.30"
#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 StarMongoDbHelper as a Cake Addin #addin nuget:?package=StarMongoDbHelper&version=23.8.30 // Install StarMongoDbHelper as a Cake Tool #tool nuget:?package=StarMongoDbHelper&version=23.8.30
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
基于MongoDB.Entities的MongoDB数据库辅助类,支持更多框架,封装了常用方法: 获取列表数据、获取单条数据、通过过滤条件获取单条数据、新增修改数据、更新单条数据、根据条件批量更新数据、聚合查询、创建删除索引等
// 获取列表数据:
db.List("users",JObject.FromObject({page:1,psize:1000,filter:JSON.stringify({"_id":id}),fields:JSON.stringify(['_id'])})).Result
// 获取单条数据:
db.Get("users","xxxxxxx",fields).Result
// 通过过滤条件获取一条数据:
db.GetOne("users",JObject.FromObject({username:'yyfs'}),fields).Result
// 新增修改数据:
db.Save('users',JObject.FromObject(data),ret.optuser).Result
// 更新单条数据:
db.UpdateOne("users",JObject.FromObject({username:'yyfs'}),JObject.FromObject({status:0}),ret.optuser).Result;
// 更新数据:
db.Update("users",xxxxxxxx“”,JObject.FromObject({status:0}),ret.optuser).Result;
// 根据条件批量更新数据:
db.UpdateMany("users",JObject.FromObject({status:0}),JObject.FromObject({status:1}),ret.optuser).Result;
//聚合查询:
var data=[
{ $match: { "id":id }},
{ $unwind: "$cost" },
{
$group : {
_id : "$_id", //必须是_id
cost: { $sum : "$cost"} //cost 可以是任意值
}
}
];
db.aggregate('users',true,data).Result;
//创建删除索引:
db.CreateDbIndex("users","abc",[{"a":"aaa"},{"b":"bbb"}])
db.DropDbIndex("users","abc")
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 is compatible. netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETCoreApp 2.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETCoreApp 2.2
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETCoreApp 3.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETCoreApp 3.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.6.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.6.2
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.7
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.7.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.7.2
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.8
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.8.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.1
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
net5.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
net6.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
-
net7.0
- MongoDB.Entities (>= 21.0.2)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.