mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
Update mongodb
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Dm.util;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization;
|
||||
using System;
|
||||
@@ -582,6 +583,22 @@ namespace SqlSugar.MongoDb
|
||||
{
|
||||
return col.DbColumnName == "_id" || col.DataType == nameof(ObjectId);
|
||||
}
|
||||
|
||||
internal static bool IsMongoVariable(BsonValue memberName)
|
||||
{
|
||||
return memberName is BsonString s && s.Value?.StartsWith("$")==true;
|
||||
}
|
||||
internal static BsonValue GetMemberName(BsonValue memberName)
|
||||
{
|
||||
if (memberName is BsonDocument)
|
||||
return memberName;
|
||||
if (memberName is BsonArray)
|
||||
return memberName;
|
||||
else if (UtilMethods.IsMongoVariable(memberName))
|
||||
return memberName;
|
||||
else
|
||||
return $"${memberName}";
|
||||
}
|
||||
//public static object ConvertDataByTypeName(string ctypename,string value)
|
||||
//{
|
||||
// var item = new ConditionalModel() {
|
||||
|
Reference in New Issue
Block a user