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.
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:
When you execute the view with the preceding key filter, you will only see records that pertain to the particular key, as shown here:
keys=["2007","2008"]
We can explicitly specify a list of keys to get only those particular keys...