ServerTimestamp
@propertyWrapper
public struct ServerTimestamp<Value>: Codable
where Value: ServerTimestampWrappable & Codableextension ServerTimestamp: Equatable where Value: Equatableextension ServerTimestamp: Hashable where Value: HashableA property wrapper that marks an Optional<Timestamp> field to be
populated with a server timestamp. If a Codable object being written
contains a nil for an @ServerTimestamp-annotated field, it will be
replaced with FieldValue.serverTimestamp() as it is sent.
Example:
struct CustomModel {
@ServerTimestamp var ts: Timestamp?
}
Then writing CustomModel(ts: nil) will tell server to fill ts with
current timestamp.
-
Undocumented
Declaration
Swift
public init(wrappedValue value: Value?) -
Undocumented
Declaration
Swift
public var wrappedValue: Value? { get set }
-
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws