FirebaseFirestore Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
ExplicitNull
@propertyWrapper
public struct ExplicitNull<Value>
extension ExplicitNull: Equatable where Value: Equatable
extension ExplicitNull: Hashable where Value: Hashable
extension ExplicitNull: Encodable where Value: Encodable
extension ExplicitNull: Decodable where Value: Decodable
Wraps an Optional
field in a Codable
object such that when the field
has a nil
value it will encode to a null value in Firestore. Normally,
optional fields are omitted from the encoded document.
This is useful for ensuring a field is present in a Firestore document,
even when there is no associated value.
-
-
Declaration
Swift
public var wrappedValue: Value? { get set }
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public init(from decoder: Decoder) throws
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.
[null,null,["Last updated 2025-03-11 UTC."],[],[],null,["ExplicitNull \n\n @propertyWrapper\n public struct ExplicitNull\u003cValue\u003e\n\n extension ExplicitNull: Equatable where Value: Equatable\n\n extension ExplicitNull: Hashable where Value: Hashable\n\n extension ExplicitNull: Encodable where Value: Encodable\n\n extension ExplicitNull: Decodable where Value: Decodable\n\nWraps an `Optional` field in a `Codable` object such that when the field\nhas a `nil` value it will encode to a null value in Firestore. Normally,\noptional fields are omitted from the encoded document.\n\nThis is useful for ensuring a field is present in a Firestore document,\neven when there is no associated value.\n- `\n ``\n ``\n `\n\n [init(wrappedValue:)](#/s:17FirebaseFirestore12ExplicitNullV12wrappedValueACyxGxSg_tcfc)`\n ` \n Undocumented \n\n Declaration \n Swift \n\n public init(../Structs/ExplicitNull.html#/s:17FirebaseFirestore12ExplicitNullV12wrappedValuexSgvp value: Value?)\n\n- `\n ``\n ``\n `\n\n [wrappedValue](#/s:17FirebaseFirestore12ExplicitNullV12wrappedValuexSgvp)`\n ` \n Undocumented \n\n Declaration \n Swift \n\n public var wrappedValue: Value? { get set }\n\n[Available where \\`Value\\`: \\`Encodable\\`](#/Available-where-%60Value%60%3A-%60Encodable%60)\n\n- `\n ``\n ``\n `\n\n [encode(to:)](#/s:SE6encode2toys7Encoder_p_tKF)`\n ` \n\n Declaration \n Swift \n\n public func encode(to encoder: Encoder) throws\n\n[Available where \\`Value\\`: \\`Decodable\\`](#/Available-where-%60Value%60%3A-%60Decodable%60)\n\n- `\n ``\n ``\n `\n\n [init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`\n ` \n\n Declaration \n Swift \n\n public init(from decoder: Decoder) throws"]]