BulkDocuments

public struct BulkDocuments

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: /db/_bulk_docs

  • If false, prevents the database from assigning documents new revision IDs.
    If new_edits is nil, CouchDB defaults to true.

    Declaration

    Swift

    public let new_edits: Bool?
  • An array of JSON Document objects.

    Declaration

    Swift

    public var docs: [[String: Any]]
  • Initialize a BulkDocuments instance from the documents [String: Any] representation.

    Declaration

    Swift

    public init(docs: [[String: Any]], new_edits: Bool? = nil)

    Parameters

    docs

    An array of JSON Document objects.

  • Initialize a BulkDocuments instance by encoding a Document array.

    Throws

    An encoding error if JSONEncoder fails to encode the Document.

    Declaration

    Swift

    public init<T: Document>(encoding: [T], new_edits: Bool? = nil) throws

    Parameters

    docs

    An array of JSON Document objects.