[CSHARP-1962] Linq projection execute on client side Created: 14/Apr/17  Updated: 27/Oct/23  Resolved: 14/Apr/17

Status: Closed
Project: C# Driver
Component/s: Linq
Affects Version/s: 2.2.4
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Ilya Assignee: Robert Stam
Resolution: Works as Designed Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 8.1



 Description   

Hello.
I use mongocharpdriver with legacy driver.
Code like this:

var result = objectsCollection.AsQueryable().Select(o => o.Id).ToList();

was executed very slowly because it is running on client side and deserialising all objects in collection.
Why linq query like this do not executed on server side?



 Comments   
Comment by Robert Stam [ 14/Apr/17 ]

The Legacy API exists for backward compatibility only and is no longer being enhanced. The LINQ implementation in the Legacy API does not support server side projections.

The LINQ implementation in the current (2.x) version of the driver does support server side projections.

Generated at Wed Feb 07 21:41:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.