So I have a BsonDocument b (let’s say it has FirstName, LastName, Age), which you could access as b[“FirstName”], etc…
If I try to do b[“asdfasdf”] (which doesn’t exist of course), instead of returning null, it errors out the app. What’s the correct way to check? Do I really have to do a try/catch?
There is also an overload that lets you provide a default value:
which is slightly more convenient that using Contains when all you want to do is replace a missing value with a default value.
Edit: since the 2.0.1 version, it has been deprecated in favor of
GetValue: