FirstOrDefaultAsync creates a command to fetch only 1 piece of data or is this in memory?
I’m seeing the tracking of the query and I’m not seeing the limit in it, how does it create this instruction to obtain only 1 document
var fOptions = new FindOptions<Log, Log> { Limit = 1 };
var data = await _collection.FindAsync(f => f.Id == 200 );
exemple query intercept:
find - { \"find\" : \"log\", \"filter\" : { \"Id\" : 200, }, \"$db\" : \"xpto\", \"lsid\" : { \"id\" : CSUUID(\"375b6374-2367-4c08-b51c-5d4cd9da2f9f\") } }
the query does not change with the instruction:
var data = await _collection.FindAsync(f => f.Id == 200 && f.Date >= DateTime.UtcNow );
data.FirstOrDefaultAsync();
exemple query intercept:
find - { \"find\" : \"log\", \"filter\" : { \"Id\" : 200, }, \"$db\" : \"xpto\", \"lsid\" : { \"id\" : CSUUID(\"375b6374-2367-4c08-b51c-5d4cd9da2f9f\") } }