FirebaseFirestoreSwift Framework Reference

Encoder

struct Encoder

Undocumented

  • Undocumented

    Declaration

    Swift

    public init()
  • Returns encoded data that Firestore API recognizes.

    If possible, all types will be converted to compatible types Firestore can handle. This means certain Firestore specific types will be encoded as pass-through: this encoder will only pass those types along since that is what Firestore can handle. The same types will be encoded differently with other encoders (for example: JSONEncoder).

    The Firestore pass-through types are:

    • GeoPoint
    • Timestamp
    • DocumentReference

    Declaration

    Swift

    public func encode<T>(_ value: T) throws -> [String : Any] where T : Encodable

    Parameters

    value

    The Encodable object to convert to encoded data.

    Return Value

    A Map keyed by String representing a document Firestore API can work with.