Views API

  • reference
    +
    The Views REST API is used to index and query JSON documents.

    Description

    Views are functions written in JavaScript that can serve several purposes in your application. You can use them to: find all the documents in your database, create a copy of data in a document and present it in a specific order, create an index to efficiently find documents by a particular value or by a particular structure in the document, represent relationships between documents, and perform calculations on data contained in documents.

    View functions are stored in a design document as JSON. You can use the REST API to manage your design documents.
    Table 1. Views endpoints
    HTTP method URI path Description Admin Role

    GET

    /[bucket_name]/_design/[ddoc-name]

    Retrieves all views design documents.

    Full, Cluster, View

    GET

    /[bucket_name]/_design/[ddoc-name]/_view/[view-name]

    Retrieves views.

    Full, Cluster, View

    PUT

    /[bucket_name]/_design/[ddoc-name]

    Creates a new design document with one or more views.

    Full, Cluster

    DELETE

    /[bucket_name]/_design/[ddoc-name]

    Deletes design documents.

    Full, Cluster

    POST

    /internalSettings

    Changes the number of simultaneous requests each node can accept.

    Full, Cluster