The Couchbase Cloud UI provides a document inspector that can be used to view and edit bucket documents.
Documents can be viewed and managed under each cluster’s Tools > Documents tab.
In order to access documents in the Couchbase Cloud UI, the following permissions are required:
The Tools > Documents tab allows you to retrieve and view the individual documents that are contained within a bucket on the cluster. The retrieved documents are summarized in table format, with a row for each retrieved document. Document retrieval controls are provided at the top of the summary, which you can use to control which documents are retrieved and displayed in the summary.
The following controls are provided:
Bucket: A drop-down menu that displays the name of the bucket whose documents are currently being viewed. You can use the drop-down menu to select from a list of buckets that your associated database user has access to.
Limit: The maximum number of rows (documents) to retrieve and display at once.
Offset: The number of documents in the entire set of the current bucket that should be skipped, before display begins.
Document ID: Accepts the ID of a specific document. Leave this field blank to retrieve documents based on Limit and Offset.
N1QL WHERE: Accepts a N1QL query — specifically a WHERE clause — which determines the subset of documents to be displayed.
This field is only enabled if the Query Service is running on the cluster.
After configuring any of the above controls, click Retrieve Docs to retrieve a new set of documents based on your configurations. Under Results, each document is represented by an individual row that contains the document’s ID and Content Summary.
After retrieving a set of documents, clicking on a row in the Results section opens the document in the Document fly-out menu, which allows you to make direct edits to the document.
The document displays in the JSON tab, and consists of a series of key-value pairs (or, as they are sometimes expressed, name-value pairs). You can make modifications to key-values directly in the JSON editor. Click Save to save your changes.
You can view the document’s metadata by clicking on the Meta tab. Couchbase generates metadata in association with each document when the document is saved, and thus can’t be directly edited. (Read more about document metadata.)
If you want to create an entirely new document, you can click Add Document. This opens the Document fly-out menu, which has a field for entering the Document ID, as well as an editor for entering the contents of the document. Click Save to create the document.
To delete a document, start by retrieving the desired document so that it appears in the Results section. Then click the Trash icon at the end of the row on the right side, and when prompted to confirm the deletion, click Confirm.
To import a set of JSON documents, or a CSV file see the Import page.