mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 10:38:09 +08:00
Update mongodb
This commit is contained in:
@@ -12,6 +12,7 @@ namespace MongoDb.Ado.data
|
||||
{
|
||||
public class QueryFindHandlerAsync : IQueryHandlerAsync
|
||||
{
|
||||
public HandlerContext Context { get; set; }
|
||||
public CancellationToken token { get; set; }
|
||||
public async Task<DbDataReader> HandlerAsync(IMongoCollection<BsonDocument> collection, BsonValue doc)
|
||||
{
|
||||
@@ -34,7 +35,7 @@ namespace MongoDb.Ado.data
|
||||
throw new ArgumentException("Invalid JSON format for MongoDB find operation.");
|
||||
}
|
||||
|
||||
var findFluent = collection.Find(filter);
|
||||
var findFluent =Context?.IsAnyServerSession==true? collection.Find(Context.ServerSession,filter) : collection.Find(filter);
|
||||
|
||||
if (projection != null)
|
||||
findFluent = findFluent.Project<BsonDocument>(projection);
|
||||
|
Reference in New Issue
Block a user