Options
All
  • Public
  • Public/Protected
  • All
Menu

Schema for a design document.

Hierarchy

  • DesignDocument

Indexable

[propName: string]: any

DesignDocument accepts additional properties.

Index

Properties

Optional _attachments

_attachments?: export=.JsonObject

Schema for a map of attachment name to attachment metadata.

Optional _conflicts

_conflicts?: string[]

Schema for a list of document revision identifiers.

Optional _deleted

_deleted?: boolean

Deletion flag. Available if document was removed.

Optional _deleted_conflicts

_deleted_conflicts?: string[]

Schema for a list of document revision identifiers.

Optional _id

_id?: string

Document ID.

Optional _local_seq

_local_seq?: string

Document's update sequence in current database. Available if requested with local_seq=true query parameter.

Optional _rev

_rev?: string

Schema for a document revision identifier.

Optional _revisions

_revisions?: export=.Revisions

Schema for list of revision information.

Optional _revs_info

Schema for a list of objects with information about local revisions and their status.

Optional autoupdate

autoupdate?: boolean

Indicates whether to automatically build indexes defined in this design document.

Optional filters

Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.

Optional indexes

Search (text) index function definitions.

Optional language

language?: string

Defines Query Server key to process design document functions.

Optional options

Schema for design document options.

Optional st_indexes

st_indexes?: export=.JsonObject

Schema for geospatial index function definitions.

Optional validate_doc_update

validate_doc_update?: string

Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.

The validation function can abort the pending document write by throwing one of two error objects:

// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.'
});

// change is not allowed throw({ forbidden: 'Error message here.' });

The function takes 4 parameters:

  • newDoc - New version of document that will be stored from the update request.
  • oldDoc - Previous version of document that is already stored.
  • userCtx - User Context Object, containing information about the user writing the document (if present), see the UserContext.
  • secObj - Security Object, with lists of database security roles, see the SecurityObject.

Optional views

Schema for design document views.

Generated using TypeDoc