Document
public class Document : DictionaryProtocol, Equatable, Hashable, SequenceCouchbase Lite document. The Document is immutable.
- 
                  
                  The document’s ID. DeclarationSwift public var id: String
- 
                  
                  Sequence number of the document in the database. This indicates how recently the document has been changed: every time any document is updated, the database assigns it the next sequential sequence number. Thus, if a document’s sequenceproperty changes that means it’s been changed (on-disk); and if one document’ssequenceis greater than another’s, that means it was changed more recently.DeclarationSwift public var sequence: UInt64
- 
                  
                  Returns a mutable copy of the document. DeclarationSwift public func toMutable() -> MutableDocumentReturn ValueThe MutableDocument object. 
- 
                  
                  The number of properties in the document. DeclarationSwift public var count: Int
- 
                  
                  An array containing all keys, or an empty array if the document has no properties. DeclarationSwift public var keys: Array<String>
- 
                  
                  Gets a property’s value. The value types are Blob, ArrayObject, DictionaryObject, Number, or String based on the underlying data type; or nil if the value is nil or the property doesn’t exist. DeclarationSwift public func value(forKey key: String) -> Any?ParameterskeyThe key. Return ValueThe value or nil. 
- 
                  
                  Gets a property’s value as a string. Returns nil if the property doesn’t exist, or its value is not a string. DeclarationSwift public func string(forKey key: String) -> String?ParameterskeyThe key. Return ValueThe String object or nil. 
- 
                  
                  Get a property’s value as an NSNumber object. DeclarationSwift public func number(forKey key: String) -> NSNumber?ParameterskeyThe key. Return ValueThe NSNumber object. 
- 
                  
                  Gets a property’s value as an int value. Floating point values will be rounded. The value trueis returned as 1,falseas 0. Returns 0 if the property doesn’t exist or does not have a numeric value.DeclarationSwift public func int(forKey key: String) -> IntParameterskeyThe key. Return ValueThe Int value. 
- 
                  
                  Gets a property’s value as an int64 value. Floating point values will be rounded. The value trueis returned as 1,falseas 0. Returns 0 if the property doesn’t exist or does not have a numeric value.DeclarationSwift public func int64(forKey key: String) -> Int64ParameterskeyThe key. Return ValueThe Int64 value. 
- 
                  
                  Gets a property’s value as a float value. Integers will be converted to float. The value trueis returned as 1.0,falseas 0.0. Returns 0.0 if the property doesn’t exist or does not have a numeric value.DeclarationSwift public func float(forKey key: String) -> FloatParameterskeyThe key. Return ValueThe Float value. 
- 
                  
                  Gets a property’s value as a double value. Integers will be converted to double. The value trueis returned as 1.0,falseas 0.0. Returns 0.0 if the property doesn’t exist or does not have a numeric value.DeclarationSwift public func double(forKey key: String) -> DoubleParameterskeyThe key. Return ValueThe Double value. 
- 
                  
                  Gets a property’s value as a boolean value. Returns true if the value exists, and is either trueor a nonzero number.DeclarationSwift public func boolean(forKey key: String) -> BoolParameterskeyThe key. Return ValueThe Bool value. 
- 
                  
                  Get a property’s value as a Blob object. Returns nil if the property doesn’t exist, or its value is not a blob. DeclarationSwift public func blob(forKey key: String) -> Blob?ParameterskeyThe key. Return ValueThe Blob object or nil. 
- 
                  
                  Gets a property’s value as a Date value. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns nil if the value doesn’t exist, is not a string, or is not parseable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds. DeclarationSwift public func date(forKey key: String) -> Date?ParameterskeyThe key. Return ValueThe Date value or nil 
- 
                  
                  Get a property’s value as a ArrayObject, which is a mapping object of an array value. Returns nil if the property doesn’t exists, or its value is not an array. DeclarationSwift public func array(forKey key: String) -> ArrayObject?ParameterskeyThe key. Return ValueThe ArrayObject object or nil. 
- 
                  
                  Get a property’s value as a DictionaryObject, which is a mapping object of a dictionary value. Returns nil if the property doesn’t exists, or its value is not a dictionary. DeclarationSwift public func dictionary(forKey key: String) -> DictionaryObject?ParameterskeyThe key. Return ValueTHe DictionaryObject object or nil. 
- 
                  
                  Tests whether a property exists or not. This can be less expensive than value(forKey:), because it does not have to allocate an object for the property value. DeclarationSwift public func contains(key: String) -> BoolParameterskeyThe key. Return ValueTrue of the property exists, otherwise false. 
- 
                  
                  Gets content of the current object as a Dictionary. The value types of the values contained in the returned Dictionary object are Array, Blob, Dictionary, Number types, NSNull, and String. DeclarationSwift public func toDictionary() -> Dictionary<String, Any>Return ValueThe Dictionary representing the content of the current object. 
- 
                  
                  Gets an iterator over the keys of the document’s properties DeclarationSwift public func makeIterator() -> IndexingIterator<[String]>Return ValueThe key iterator. 
- 
                  
                  Subscript access to a Fragment object by key. DeclarationSwift public subscript(key: String) -> FragmentParameterskeyThe key. 
- 
                  
                  Equal to operator for comparing two Document objects. DeclarationSwift public static func == (doc1: Document, doc2: Document) -> Bool
 Document Class Reference
        Document Class Reference