-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.2, 2.2.3
-
Component/s: API, Performance
-
None
Hi all,
Using c# driver through Linq expressions, we've noticed that many objects are hydrated when using AsQueryable() + Linq expresion even though the query returns one result.
...
var collection = _mongoDatabase.GetCollection<User>("Users");
var usersFound = collection.AsQueryable().Where(x => x.UserName == "John Doe");
...
By the other hand, if we use Eq method, the behavior is the expected: there is only one object hydrated.
...
var filter = Builders<User>.Filter.Eq("UserName", "John Doe");
var usersFound = collection.Find(filter);
...
Is that te implemented behaviour of the driver using Linq?
Many thanks!