Wednesday, 11 September 2013

Does the MongoDb C# driver query support Except()?

Does the MongoDb C# driver query support Except()?

var querycodes= new string[] {"aaa", "bbb", "ccc"};
var query = collection.AsQueryable<Source>()
.Where(d => (d.codes.Count == querycodes.Count() &&
!d.codes.Except(querycodes).Any()));
It's throwing error:
Unable to determine the serialization information for the expression:
Enumerable.Count(Enumerable.Except(d.codes, String[]:{ "aaa", "bbb" ...
})).
How can I achieve query targets?

No comments:

Post a Comment