Update mongodb

This commit is contained in:
sunkaixuan 2025-05-05 21:46:34 +08:00
parent 6f0b17cf6c
commit 5de89443b3

View File

@ -1,4 +1,6 @@
using SqlSugar.MongoDbCore; using MongoDB.Bson.IO;
using MongoDB.Bson;
using SqlSugar.MongoDbCore;
using System; using System;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
@ -12,7 +14,11 @@ namespace SqlSugar.MongoDb
context.resolveType = resolveType; context.resolveType = resolveType;
context.context = this.Context; context.context = this.Context;
var sql=MongoNestedTranslator.Translate(expression, context); var sql=MongoNestedTranslator.Translate(expression, context);
this.Result.Append(sql); var shellString = sql.ToJson(new JsonWriterSettings
{
OutputMode = JsonOutputMode.Shell
});
this.Result.Append(shellString);
} }
public SqlSugarProvider Context { get; set; } public SqlSugarProvider Context { get; set; }