asObjectId

fun asObjectId(): BsonObjectId

Gets this value as an BsonObjectId if it is one, otherwise throws exception

Return

an BsonObjectId

Throws

if this value is not of the expected type