Reputation: 26899
I'm refactoring away from the .NET Legacy MongoDB Drivers. I've got a query that's written using the Legacy API's ContainsAny() method. In the query below affectedFormFieldIds is a list of IDs.
This Throws an ArgumentException stating that this is an Unsupported Filter.
Queryable<FormSectionColumnLayoutReadModel>().Where(x => x.Fields.ContainsAny(affectedFormFieldsIds));
How do I rewrite this query using the new API
Upvotes: 0
Views: 336
Reputation: 1222
It's
Queryable<FormSectionColumnLayoutReadModel>()
.Where(x => affectedFormFieldsIds.Any(a => x.Fields.Contains(a)));
Upvotes: 1