[CSHARP-4666] Support projecting a single field with Find on servers prior to 4.4 Created: 05/Jun/23 Updated: 28/Oct/23 Resolved: 11/Jul/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.21.0 |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | Shawn Weaver | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Documentation Changes: | Not Needed | ||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
| Comments |
| Comment by Githook User [ 11/Jul/23 ] | ||||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: | ||||
| Comment by Robert Stam [ 11/Jul/23 ] | ||||
|
We have re-examined this issue with valuable insights provided by Oleksandr who encouraged us to consider supporting this particular use case in spite of the fact that we don't intend to support client-side projections in general. Therefore I am re-opening this ticket. | ||||
| Comment by Oleksandr Poliakov [ 03/Jul/23 ] | ||||
|
Hi, shawn.weaver@americanautoshield.com
3) Configure MongoClient to use Linq2 provider, but keep in mind that LINQ2 provider eventually will be deprecated and removed.
I hope this helps.
| ||||
| Comment by Oleksandr Poliakov [ 12/Jun/23 ] | ||||
|
Hi shawn.weaver@americanautoshield.com, thank you for reporting the problem! We've reproduced the problem and can confirm that it affects all server versions before 4.4. We will prepare a fix for the problem. Meanwhile you can either update your code to the following snippet to make the client-side projection:
or configure the mongo client to use Linq2 provider:
| ||||
| Comment by PM Bot [ 05/Jun/23 ] | ||||
|
Hi shawn.weaver@americanautoshield.com, thank you for reporting this issue! The team will look into it and get back to you soon. |