8. Build an index for use with Cloudant Query
- From the database view in the Dashboard, click the Add (+) icon for Design Documents.
- Select Query Indexes.
- In the Cloudant Query index editor, change the default field of
foo
tofield2
. - Keep the index type set to
json
. - Click Create Index.
Cloudant will create the index and display status updates along the top of the Dashboard page.
- After confirmation that the index has been created, click on the database name to return to the database view.
- Click Query.
- In the Query editor, update the selector to choose documents where
"field2"
is equal to"value2."
- Simplify the query by removing the fields and sort options.
- Click Run Query to display the results of the query.
The document matched by the query is shown with all of the document fields.