mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 21:13:46 +08:00
Update mongodb
This commit is contained in:
@@ -60,6 +60,10 @@ namespace SqlSugar.MongoDb
|
||||
{
|
||||
projectionDocument[fieldName] = json;
|
||||
}
|
||||
else if (memberAssignment.Expression is MethodCallExpression callExpression&&callExpression.Method.Name==nameof(SqlFunc.IIF))
|
||||
{
|
||||
projectionDocument[fieldName] = json;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectionDocument[fieldName] = "$" + json.ToString();
|
||||
|
@@ -45,7 +45,7 @@ namespace SqlSugar.MongoDb
|
||||
var funcString = context.ToString(model);
|
||||
result = BsonDocument.Parse(funcString);
|
||||
}
|
||||
else if (name.StartsWith("To"))
|
||||
else if (name.StartsWith("To")||name==nameof(SqlFunc.IIF))
|
||||
{
|
||||
var value = context.GetType().GetMethod(name).Invoke(context, new object[] { model });
|
||||
result = BsonDocument.Parse(value?.ToString());
|
||||
|
Reference in New Issue
Block a user