[CSHARP-4339] Add support for $documents in LINQ Created: 30/Sep/22  Updated: 23/Mar/23  Resolved: 14/Dec/22

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: None
Fix Version/s: 2.19.0

Type: Improvement Priority: Unknown
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-4220 Expose $documents as external stage Closed

 Description   

In CSHARP-4220 we added support for the $documents stage using the aggregation builder APIs.

This ticket is about adding similar support in LINQ.

The syntax could look like this:

var result = database.AsQueryable()
    .Documents(documents)
    // more LINQ

Note that there currently is not an AsQueryable method on database (only on collection), so this would be a new method.

Also, the LINQ machinery currently assumes that all LINQ queries are against a collection, so before the LINQ version of Documents can be implemented the LINQ machinery will have to be refactored to allow queries against either a collection or a database.

 



 Comments   
Comment by Githook User [ 14/Dec/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4339: Add support for $documents in LINQ.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/32835bf74fd30a032cc426365f363bcdd2aed814

Comment by Githook User [ 14/Dec/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4339: Added database.AsQueryable().
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/9bdc91949432aa9299973e8fb0a6d1dc2c022e10

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