asObjectId

abstract fun asObjectId(): <ERROR CLASS>

Returns the value from this RealmAny as a BsonObjectId.

Throws

if the stored value cannot be safely converted to BsonObjectId.