Structures
The following structures are available globally.
-
The connection properties of a
See moreCouchDBClient
instanceDeclaration
Swift
public struct ConnectionProperties
-
A struct representing the JSON response from CouchDB when an error occurs.
CouchDB reference:
See moreCouchDB_Error_Status
Declaration
Swift
public struct CouchDBError: Codable, Swift.Error, CustomStringConvertible
-
A struct representing the JSON returned when querying a Database or View. If
includeDocuments
was true for the query, each row will have an additionaldoc
field containing the JSON document. These documents can then be decoded to a given Swift type usingdecodeDocuments(ofType:)
.CouchDB reference:
All_Database_Documents
Usage Example:
See morestruct MyDocument: Document { let _id: String? var _rev: String? var value: String } database.retrieveAll(includeDocuments: true) { (allDocs, error) in if let allDocs = allDocs, let decodedDocs = allDocs.decodeDocuments(ofType: MyDocument) { for doc in decodedDocs { print("Retrieved MyDocument with value: \(doc.value)") } } }
Declaration
Swift
public struct AllDatabaseDocuments
-
A struct representing an array of JSON documents. This is used for adding or updating multiple documents at once using the bulk api.
CouchDB reference:
See more/db/_bulk_docs
Declaration
Swift
public struct BulkDocuments
-
A struct representing an item in the response JSON Array of Objects from an HTTP request to the _bulk_docs API.
CouchDB reference:
See more/db/_bulk_docs
Declaration
Swift
public struct BulkResponse: Codable
-
This struct represents the agreed upon fields and structure of a design documents. The filters, lists, shows and updates fields objects are mapping of function name to string function source code. The views mapping is the same except that values are objects with map and reduce (optional) keys which also contains functions source code.
CouchDB reference:
See more/db/_design/design-doc
Declaration
Swift
public struct DesignDocument: Document