[CSHARP-468] Any() query on subdocument inside of Where() throws exception Created: 09/May/12 Updated: 20/Mar/14 Resolved: 09/May/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ryan Hoffman | Assignee: | Craig Wilson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Given these entities: public class Person public string Name { get; set; } public List<Address> Addresses { get; set; }} public class Address { public string Street { get; set; } public string City { get; set; }public string State { get; set; } public string Zip { get; set; }} This query does not work: (people = MongoCollection<Person>) It would be the equivalent of this query in the shell: ) The exception thrown is: For now, I am using the Inject() workaround, however this type of query I believe needs to be supported. |
| Comments |
| Comment by Craig Wilson [ 09/May/12 ] |
|
This is scheduled for the 1.5 release and will result in an $elemMatch element getting generated. |
| Comment by Ryan Hoffman [ 09/May/12 ] |
|
Another way to express this query is: This fails with this exception: |