getValue

open fun <V> getValue(key: String): V

Retrieves a value from the document with type casting.

This method provides type-safe access to document values by performing an unchecked cast. Use with caution and ensure the value is actually of the expected type.

Return

The value cast to type V.

Parameters

V

The expected type of the value.

key

The key to retrieve the value for.

Throws

if the value cannot be cast to the specified type.

if the key is not present in the document.