Filtering and transforming data

We have written views in the form of map and reduce functions. A view creates indexes and stores them on disk for all documents with the output of map function, along with reduce function's output. Couchbase provides a filtering mechanism for documents generated by views. We can also perform some transformation on data using; the group level, which is discussed subsequently.

Using keys

We can specify key values to filter documents while querying views, like this:

key="2008"

We can also specify a key explicitly to get only that particular key's details. Here, we will get only the view record that pertains to the 2008 key, as follows:

The following screenshot shows the interface to key in the, key to filter indexes:

Key ...

Get Learning Couchbase now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.