decodeNull

abstract fun decodeNull(): Nothing?(source)

Decodes this value as a Kotlin null.

Note that we differentiate "the value is not present" with "the value as the BSON type null". This method only returns successfully in the presence of the BSON type null.

A BsonValue cannot represent an absent value, so there is no "check if present" method. Instead, BsonDocument.get and BsonArray.get return null (NOT a BsonValue that decodes to null) if the field is absent.

Throws

If the value is not a BsonType.Null.