asObjectId

abstract fun asObjectId(): BsonObjectId

Returns the value from this RealmAny as a BsonObjectId.

Throws

if the stored value cannot be safely converted to BsonObjectId.