8. Build an index for use with Cloudant Query

  1. From the database view in the Dashboard, click the Add (+) icon for Design Documents.
  2. Select Query Indexes.
  3. In the Cloudant Query index editor, change the default field of foo to field2.
  4. Keep the index type set to json.

  5. Click Create Index.

    Cloudant will create the index and display status updates along the top of the Dashboard page.

  6. After confirmation that the index has been created, click on the database name to return to the database view.
  7. Click Query.

  8. In the Query editor, update the selector to choose documents where "field2" is equal to "value2."

  9. Simplify the query by removing the fields and sort options.
  10. Click Run Query to display the results of the query.

    The document matched by the query is shown with all of the document fields.