我有这个 MongoDB 无法执行的链式 LINQ 查询:
RoleCollection.AsQueryable().Where(r => r.Users.Any(id => id == user.Id))
.Select(r => r.Name).ToArray();
这会导致以下错误:
Any is only support for items that serialize into documents. The current serializer is ObjectIdSerializer and must implement IBsonDocumentSerializer for participation in Any queries.
如何将查询转换为 Mongo 支持的本机查询?