MongoDb c#driver 2.0 BsonNull用法

Vla*_*dak 3 .net c# mongodb mongodb-csharp-2.0 mongodb-.net-driver

isDeleted NullableProfile课堂上有财产.

Builders<Profile>.Filter.Eq(p => p.IsDeleted, BsonNull.Value)
Run Code Online (Sandbox Code Playgroud)

但是下面的代码引发了下一个编译错误:

Error 11    Cannot convert lambda expression to type 
'MongoDB.Driver.FieldDefinition<MongoDB.DataTypes.Profile,MongoDB.Bson.BsonNull>' 
because it is not a delegate type   
Run Code Online (Sandbox Code Playgroud)

如何实现空检查?

i3a*_*non 5

如果可以IsDeleted为空,则可以使用简单null而不是BsonNull.Value查询时:

Builders<Profile>.Filter.Eq(p => p.IsDeleted, null)
Run Code Online (Sandbox Code Playgroud)