I have this chained LINQ query which MongoDB fails to execute:
RoleCollection.AsQueryable().Where(r => r.Users.Any(id => id == user.Id))
.Select(r => r.Name).ToArray();
This results in the following error:
Any is only support for items that serialize into documents. The current serializer is ObjectIdSerializer and must implement IBsonDocumentSerializer for participation in Any queries.
How can I translate the query into a native query which Mongo will support?
I got the following query working, although I’m not entirely certain as to its semantics yet: