Congratulations - C# Corner Q4, 2022 MVPs Announced
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Aniket Narvankar
852
2k
501.3k
How to construct an MongoDB Linq Any() query by comparing a sub-field
Apr 5 2021 7:47 AM
I need help on how to use linq Any with mongodb in c sharp
Following is the query I have written
builder.Where(d => d.DepartmentId == appSettings.ClientId && d.IsCompleted == 0 && d.ScanDate >= fromDate_ && d.ScanDate <= toDate_&&d => op.ProviderLocMappings.Any(pm => d.BatchDocumentEntity.ProviderName.Any(pnm => pnm.Name.Equals(pm.Key) && pnm.Selected == true) && pm.Value.Contains(d.BatchDocumentEntity.Location))).ToList();
It is returning list of documents
But it gives me error unsupported filtered Type Any. Kindly guide me on this how to use Any over here
Reply
Answers (
0
)
how to filter column name as well as respective va
Conversion from string to int in LINQ to SQL query