DataSnapshot
public extension DataSnapshot
-
Retrieves the value of a snapshot and converts it to an instance of caller-specified type. Throws
DecodingError.valueNotFound
if the document does not exist andT
is not anOptional
.See
Database.Decoder
for more details about the decoding process.Declaration
Swift
func data<T: Decodable>(as type: T.Type, decoder: Database.Decoder = Database.Decoder()) throws -> T