DesignDocument

public struct DesignDocument: Document

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: /db/_design/design-doc

  • _id

    The document ID.

    Declaration

    Swift

    public let _id: String?
  • The document revision.

    Declaration

    Swift

    public let _rev: String?
  • The Query Server key to process design document functions. If this is nil, the language is assumed to be Javascript.

    Declaration

    Swift

    public let language: String?
  • The View’s default options.

    Declaration

    Swift

    public let options: [String: Bool]?
  • Initialize a DesignDocument instance.

    Declaration

    Swift

    public init(_id: String? = nil,
            _rev: String? = nil,
            language: String? = nil,
            options: [String: Bool]? = nil,
            filters: [String: String]? = nil,
            lists: [String: String]? = nil,
            rewrites: [String]? = nil,
            shows: [String: String]? = nil,
            updates: [String: String]? = nil,
            validate_doc_update: String? = nil,
            views: [String: [String: String]]? = nil
    )

    Parameters

    language

    The coding language.

    options

    The View’s default options.

    filters

    Filter functions definition.

    lists

    Lists functions definition.

    rewrites

    Rewrite rules definition.

    shows

    Show functions definition.

    updates

    Update functions definition.

    views

    View functions definition.