MapReduce Views

    You can use MapReduce views to create queryable indexes in Couchbase Server.
    Views is deprecated in Couchbase Server 7.0, and will eventually move to unsupported status. Views date from the earliest days of Couchbase Server development, and as such are rarely the best choice over, say, our Query service for your application, see our guide to choosing the right service. We will maintain support for Views in the SDKs for so long as it can be used with a supported version of Couchbase Server.

    MapReduce Views

    Views are stored in design documents. The SDK provides convenient methods to create, retrieve, and remove design documents. To set up views, you create design documents that contain one or more view definitions, and then insert the design documents into a bucket.

    Creating design documents

    Each view in a design document is represented by a name and a set of MapReduce functions. The mandatory map function describes how to select and transform the data from the bucket, and the optional reduce function describes how to aggregate the results.

    Retrieving design documents

    To inspect design documents, you can either retrieve them by name or iterate through a list of documents.