[CSHARP-413] Add support for Enumerable.Any in LINQ queries Created: 19/Mar/12  Updated: 18/Jun/15  Resolved: 15/May/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.5

Type: New Feature Priority: Major - P3
Reporter: Robert Stam Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-468 Any() query on subdocument inside of ... Closed
is duplicated by CSHARP-491 LINQ Feature Doesn't Support $elemMatch Closed
is duplicated by CSHARP-425 Linq Support For Any() extension method Closed
Related
related to CSHARP-1325 Extend support for Enumerable.Any wit... Closed

 Description   

Add support for LINQ queries like:

var query1 = from c in collection.AsQueryable<C>()
             where c.A.Any(a => (a % 2) == 0 && a > 2)
             select c;

This example assumes c.A is an array of ints and is looking for documents where c.A contains an even number greater than 2. It requires use of $elemMatch, but there is some concern about use of $elemMatch when the array values are not embedded documents.

In any case, full support for mapping arbitrary C# predicates on array elements requires robust $elemMatch support in the server, including support for scalar or document values as well as $and and $or.



 Comments   
Comment by Craig Wilson [ 15/May/12 ]

This has been merged to master to support arrays of documents. Arrays of primitives are not yet supported server-side.

Comment by Robert Stam [ 25/Apr/12 ]

Scheduled for 1.5. But date of 1.5 is not yet fixed.

Comment by joe devenny [ 25/Apr/12 ]

What is the status on this?

Comment by Robert Stam [ 02/Apr/12 ]

Not yet, but if possible it will be in the 1.4.1 release.

Comment by joe devenny [ 02/Apr/12 ]

If this feature will be added, is there a timeframe?

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