Views and indexes
Couchbase views enable indexing and querying of data.
A view creates an index on the data according to the defined format and structure. The view consists of specific fields and information extracted from the objects in Couchbase.
Views are eventually consistent compared to the underlying stored documents. Documents are included in views when the document data is persisted to disk. Documents with expiry times are removed from indexes when the expiration pager operates to remove the document from the database.
Views are used for a number of reasons, including:
- Indexing and querying data from stored objects
- Producing lists of data on specific object types
- Producing tables and lists of information based on your stored data
- Extracting or filtering information from the database
- Calculating, summarizing or reducing the information on a collection of stored data
- Creating and querying stored data
- Performing queries and selection on the data
- Paginating through the view output
The View Builder provides an interface for creating views within the web console. Views can be accessed by using a Couchbase client library to retrieve matching records.