Once you have Couchbase Server running, you can log into the Couchbase Server Web Console, and start to examine the different features that it provides. These features include an interface for inspecting Couchbase documents, organized within buckets.
运行Couchbase服务器后,可以登录到Couchbase服务器Web控制台,并开始检查它提供的不同特性。这些特性包括用于检查Couchbase文档的接口,这些文档组织在bucket中。
Access the Console and Log In
The default address for the Couchbase Server Web Console (whether it is running in a Docker virtual environment, or directly on your platform) is localhost:8091. Enter the address into the address bar of a supported Web browser, and hit return. The Couchbase Server log-in screen is displayed:
The Docker image that you installed comes pre-configured with a default username and password:
Username: Administrator
Password: password
Type these credentials into the appropriate fields and click Sign In.
Examine the Cluster Dashboard
Every time you log into the Web Console, you are brought to the Cluster Dashboard:
The Cluster Dashboard provides a graphical summary of the current state of your Couchbase cluster. The term cluster might seem unexpected at this point, since you are only running a single instance of Couchbase Server; but nevertheless, it counts as a cluster of one.
集群仪表板提供了Couchbase集群当前状态的图形摘要。此时,术语cluster似乎有些出乎意料,因为您只运行一个Couchbase服务器实例;但无论如何,它都被视为一个集群。
All of the values that are displayed on this screen were automatically configured by the sandbox container image during installation. In production, you will specify these values individually according to your needs.
在安装过程中,此屏幕上显示的所有值都由沙箱容器映像自动配置。在生产中,您将根据需要分别指定这些值。
Notice the Buckets panel, towards the bottom. This shows that you have a single active bucket on the system — bucket meaning a logical group of data-items. Taking a closer look at this bucket will give you some idea of how Couchbase stores data, and prepare you to make your first data-queries.
注意底部的bucket面板。这表明系统上只有一个活动bucket——bucket表示一组逻辑数据项。仔细研究这个bucket可以让您了解Couchbase如何存储数据,并为您进行第一次数据查询做好准备。
Examine Your Bucket and Its Documents
Click Buckets in the left-hand navigation bar to bring up the Buckets screen.
The Buckets screen shows that you have a single active bucket on the system (bucket meaning a logical group of data-items). Taking a closer look at this bucket will give you some idea of how Couchbase stores data, and prepare you to make your first data-queries:
bucket屏幕显示系统上只有一个活动bucket (bucket表示数据项的逻辑组)。仔细看看这个桶将让您了解Couchbase如何存储数据,并为您进行第一次数据查询做好准备:
The name of the single bucket (travel-sample) appears towards the left of the single row. Additional information is provided in columns, across the row.
单桶的名称(travel-sample)出现在单行左边。附加信息以列的形式跨行提供。
Click Documents, which is located towards the right of the travel-sample row, to go to the Documents screen.
The Documents screen lets you inspect the individual documents that are contained within the bucket:
文档屏幕让您检查bucket中包含的各个文档:
The Documents screen shows, in a succession of page-views, the documents that are contained within the bucket. The following document retrieval 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 other available buckets.
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. Notice that when you click Next Batch >, the Offset increases by the same value that is specified in Limit.
Document ID: Accepts the ID of a specific document. Leave this field blank to retrieve documents based on Limit and Offset.
Where: Accepts a N1QL query — specifically a WHERE clause — which determines the subset of documents to be displayed. (You will learn more about N1QL in a later step of this Getting Started sequence.)
文档屏幕在一系列页面视图中显示bucket中包含的文档。提供下列文件检索控制:
Bucket:一个下拉菜单,显示当前正在查看文档的Bucket的名称。您可以使用下拉菜单选择其他可用的bucket。
Limit:一次检索和显示的最大行数(文档)。
Offset-偏移量:在显示开始之前,应该跳过当前bucket的整个集合中的文档数。注意,当您单击Next Batch >时,偏移量将增加与Limit中指定的值相同的值。
Document ID:接受特定文档的ID。将此字段留空,以便根据限制和偏移量检索文档。
Where:接受N1QL查询—特别是Where子句—它决定要显示的文档子集。(在这个开始序列的后续步骤中,您将了解更多关于N1QL的信息。)
In the results, each document is represented by an individual row that contains its ID and a summary of its contents. You can switch between two views: simple and spreadsheet. In the spreadsheet view, you can edit the document fields directly, since each key has its own column in which the corresponding value for each document is provided, row by row.
在结果中,每个文档由一个单独的行表示,其中包含其ID和内容摘要。您可以在两个视图之间切换:simple和spreadsheet。在spreadsheet视图中,您可以直接编辑文档字段,因为每个键都有自己的列,其中逐行提供每个文档的对应值。
The following buttons appear on the left side of each row:
Edit document as JSON: Click this button to bring up the Edit Document dialog, which allows you to make direct edits to the document:
The document consists of a series of key-value pairs (or, as they are sometimes expressed, name-valuepairs). You can make modifications to key-values directly in this editor. As will be demonstrated later, Couchbase Server allows you to search for keys, and return the corresponding values, by means of a query. For example, here, if you searched on the name country, you would return the value United States; if on the name icao, the value MLA.
文档由一系列键-值对(或者,正如它们有时表示的那样,名称-valuepair)组成。您可以在此编辑器中直接修改键值。稍后将演示,Couchbase Server允许您通过查询搜索键并返回相应的值。例如,在这里,如果搜索name country,将返回值United States;如果对名称icao,值MLA。
If you make changes in the Edit Document dialog, click Save to save your changes. If you want to create a new document based on an existing document, you can click the Make a copy of this document button (described next). If you want to create an entirely new document, you can click the ADD DOCUMENTbutton in the upper-right.
Make a copy of this document: Click this button to bring up the Save As dialog, which allows you to create a new document based on the existing one:
Either click the Save button to save the copy under the placeholder name that is provided, or edit the placeholder-name before saving.
Note that if you are using the spreadsheet view, any unsaved changes that you have made to document key-values will be saved in the copied document and not the original, much like the behavior of traditional text editing software.
Delete this document: Click this button to delete the document.
Save changes to document: If you make changes in the spreadsheet view, this button becomes active for the current row. Click it to save your changes to the document.
To view successive sets of documents, use the Next Batch > and < Prev Batch buttons.
Next
Now that you have a basic familiarity with the way in which Couchbase Server organizes data, you can start to define and execute queries to return specific data subsets. You’ll experiment with this in the next section: Run Your First N1QL Query.
Other Destinations
Manage Buckets: Contains basic information about buckets.
Data Model: Provides more information about the Couchbase data-model.
网友评论