The Couchbase Capella UI provides the Documents tool that you can use to view and edit documents.
This page describes how you can interact with and manage documents in a Couchbase database using the Documents tool in the Capella UI.
To use the document editor in the Capella UI, you need the appropriate project role.
Accessing Documents in the Capella UI
You can use the Documents tool to view and manage documents in a database. Open the Documents tool by opening a database and clicking.
You can use the Documents tool to retrieve and view the individual documents contained within a bucket, scope, or collection on the database. The retrieved documents are summarized in a table format, with a row for each retrieved document. Document retrieval controls at the top of the summary control the retrieval and display of documents.
The Documents tool has the following controls:
Bucket: A drop-down menu that displays the name of the bucket whose documents are shown. You can use the drop-down menu to select from a list of buckets in the current database.
Scope: A drop-down menu that displays the name of the scope whose documents are shown. The
_defaultscope is the default. You can use the drop-down menu to select from a list of all the scopes within the current bucket.
Collection: A drop-down menu that displays the name of the collection whose documents are shown. The
_defaultcollection is the default. You can use the drop-down menu to select from a list of all the collections within the current scope.
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 is 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 SQL++ query-—a WHERE clause-—which determines the subset of documents to show.
This field is enabled if the Query Service is running on the database.
When you use the Bucket, Scope, or Collections controls, the set of documents is automatically updated based on your selections. After using the Limit, Offset, Document ID, or N1QL WHERE controls, you must click Retrieve Docs to retrieve a new set of documents based on your new configuration.
View and Edit Existing Documents
After retrieving a set of documents, clicking on a document name in the results area opens that document in the Document fly-out menu. This fly-out menu allows you to view and edit the document directly.
The document displays in the JSON tab and consists of a series of key-value pairs—which are sometimes expressed as name-value pairs. You can make modifications to key-values in the JSON editor. Click Save to save your changes.
You can view the document’s metadata by clicking on the Meta tab. It’s not possible to edit a document’s metadata as Couchbase Capella generates it in association with each document when they’re saved. For more information, see document metadata.
Add and Delete Documents
If you want to create a new document, you can click Add Document. This opens the Document fly-out menu, which has a field for entering the Document ID, and 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 area. Then click the Trash icon at the end of the row on the right side. When prompted to confirm the deletion, click Confirm.
To import a set of JSON documents or a CSV file, see the Import page.