ktx / com.google.firebase.firestore.ktx / com.google.firebase.firestore.QueryDocumentSnapshot / toObject

toObject

inline fun <reified T : Any> QueryDocumentSnapshot.toObject(): T

Returns the contents of the document converted to a POJO.

Parameters

T - The type of the object to create.

Return
The contents of the document in an object of type T.

inline fun <reified T : Any> QueryDocumentSnapshot.toObject(serverTimestampBehavior: ServerTimestampBehavior): T

Returns the contents of the document converted to a POJO.

Parameters

T - The type of the object to create.

serverTimestampBehavior - Configures the behavior for server timestamps that have not yet been set to their final value.

Return
The contents of the document in an object of type T.