How to create Bson Document with Null value using C# official driver?

后端 未结 2 1582
失恋的感觉
失恋的感觉 2021-01-17 18:18

I have objects with 3 string fields Country, Province, City. They can contain null or some string name.

I wanna query all data with the exact same values.

Fo

2条回答
  •  日久生厌
    2021-01-17 18:45

    I assume you are working with BsonDocuments and not C# classs. Because of that, for null values, you need to use BsonNull.Value to represent null values in the database and in queries.

提交回复
热议问题