Blob
public final class Blob : Equatable, Hashableextension Blob: CodableBlob contains arbitrary binary data, tagged with a MIME type.
Blobs can be arbitrarily large, and their data is loaded only on demand (when the content
or contentStream properties are accessed), not when the document is loaded.
The document’s raw JSON form only contains the Blob’s metadata (type, length and a digest of
the data) in a small object. The data itself is stored externally to the document, keyed by
the digest.
- 
                  
                  Value of type property for blob object DeclarationSwift public static let blobType: String
- 
                  
                  Blob dict property containing a blobType of the data. DeclarationSwift public static let typeProperty: String
- 
                  
                  Blob dict property containing a digest of the data. DeclarationSwift public static let blobDigestProperty: String
- 
                  
                  Blob dict property containing a length of the data. DeclarationSwift public static let blobLengthProperty: String
- 
                  
                  Blob dict property containing a content type of the data. DeclarationSwift public static let blobContentType: String
- 
                  
                  Initializes a Blob with the given in-memory data. DeclarationSwift public convenience init(contentType: String, data: Data)ParameterscontentTypeThe type of content this Blob will represent. dataThe data that this Blob will contain. 
- 
                  
                  Initializes a Blob with the given stream of data. DeclarationSwift public convenience init(contentType: String, contentStream: InputStream)ParameterscontentTypeThe type of content this Blob will represent. contentStreamThe stream of data that this Blob will consume. 
- 
                  
                  Initializes a Blob with the contents of a file. Throws An error on a failure.DeclarationSwift public convenience init(contentType: String, fileURL: URL) throwsParameterscontentTypeThe type of content this Blob will represent. fileURLA URL to a file containing the data that this Blob will represent. 
- 
                  
                  Gets the contents of a Blob as a block of memory. Not recommended for very large blobs, as it may be slow and use up lots of RAM. DeclarationSwift public var content: Data? { get }
- 
                  
                  A stream of the content of a Blob. The caller is responsible for opening the stream, and closing it when finished. DeclarationSwift public var contentStream: InputStream? { get }
- 
                  
                  The type of content this Blob represents; by convention this is a MIME type. DeclarationSwift public var contentType: String? { get }
- 
                  
                  The binary length of this Blob. DeclarationSwift public var length: UInt64 { get }
- 
                  
                  The cryptographic digest of this Blob’s contents, which uniquely identifies it. DeclarationSwift public var digest: String? { get }
- 
                  
                  The metadata associated with this Blob DeclarationSwift public var properties: [String : Any] { get }
- 
                  
                  Equal to operator for comparing two Blob objects. DeclarationSwift public static func == (blob1: Blob, blob2: Blob) -> Bool
- 
                  
                  DeclarationSwift public func hash(into hasher: inout Hasher)
- 
                  
                  Returns a dictionary representation of the blob object in JSON string format. The dictionary will contain only metadata information without data. If Blob is not saved in the database which means that it doesn’t have digest information, calling toJSON() will not be allowed and it will throw an NSInternalInconsistencyException. DeclarationSwift public func toJSON() -> String
- 
                  
                  Return whether the given dictionary represents Blob or not DeclarationSwift public static func isBlob(properties: [String : Any]) -> Bool
- 
                  
                  DeclarationSwift public convenience init(from decoder: any Decoder) throws
- 
                  
                  DeclarationSwift public func encode(to encoder: any Encoder) throws
 Blob Class Reference
        Blob Class Reference