DocumentSnapshot
public extension DocumentSnapshot-
Retrieves all fields in a document and converts them to an instance of caller-specified type.
By default, server-provided timestamps that have not yet been set to their final value will be returned as
NSNull. PassserverTimestampBehaviorto configure this behavior.See
Firestore.Decoderfor more details about the decoding process.Declaration
Swift
func data<T: Decodable>(as type: T.Type, with serverTimestampBehavior: ServerTimestampBehavior = .none, decoder: Firestore.Decoder = .init()) throws -> T