我正在使用mongodb c#驱动程序,并尝试以下查询。
collection.AsQueryable().Where(x => x.IsArchived.GetValueOrDefault())
其中 IsArchived 的类型为 bool?
(可空布尔值)。
我遇到了下面的运行时错误:
Unsupported where clause: x.IsArchived.GetValueOrDefault().
有人知道如何查询可空类型吗?