Docs Home / Compass / Interact with Your Data / Manage Documents

View Documents查看文档

The Documents tab provides three ways to access documents:“文档”选项卡提供了三种访问文档的方法:

List View列表视图
The default document view. Documents are shown as individual members of a list. In this view you can easily expand embedded objects and arrays.默认文档视图。文档显示为列表中的单个成员。在此视图中,您可以轻松展开嵌入式对象和数组。
JSON View视图
Documents are shown as properly-formatted JSON objects. In this view Compass uses extended JSON to display the data types of fields where appropriate.文档显示为格式正确的JSON对象。在此视图中,Compass使用扩展JSON在适当的地方显示字段的数据类型。
Table View表格视图
Shows documents as rows of a table, with document fields shown in the table columns. With this view, you can more easily see which documents contain specific field values.将文档显示为表中的行,文档字段显示在表列中。通过此视图,您可以更容易地看到哪些文档包含特定的字段值。

Use the View buttons to select which view is shown in the following examples:使用“视图”按钮选择以下示例中显示的视图:

List View
JSON View
Table View

You can reorder the table columns by clicking and dragging the column headings. Reordering the columns is a strictly cosmetic change and does not change the underlying data itself.

click to enlarge

By default, the Documents tab in Compass displays 25 documents at a time. To change the number of displayed documents per page, open the drop-down menu under the query bar and select one of the following values:默认情况下,Compass中的“文档”选项卡一次显示25个文档。要更改每页显示的文档数,请打开查询栏下的下拉菜单,然后选择以下值之一:

NOTE

If you change the number of documents displayed per page, Compass saves the new value as the new default, including when you open the Documents view in a new tab or after you restart Compass.如果更改每页显示的文档数,Compass会将新值保存为新的默认值,包括在新选项卡中打开“文档”视图时或重新启动Compass后。

Expand Embedded Objects and Arrays展开嵌入式对象和数组

To expand all objects in all documents in your collection in List View or JSON View, you can right-click the query bar or its surrounding whitespace. Then, select Expand all documents from the drop-down menu.要在列表视图或JSON视图中展开集合中所有文档中的所有对象,可以右键单击查询栏或其周围的空白。然后,从下拉菜单中选择“展开所有文档”。

Alternatively, you can open the drop-down arrow next to view selector and click Expand all documents.或者,您可以打开视图选择器旁边的下拉箭头,然后单击“展开所有文档”。

Drop-down menu to expand documents

Expand Individual Documents展开单个文档

To expand individual documents, follow the instructions below.要展开单个文档,请按照以下说明进行操作。

List View

To toggle the expansion of embedded objects and array elements, hover over the target document and click the arrow in the top-left corner.要切换嵌入式对象和数组元素的展开,请将鼠标悬停在目标文档上,然后单击左上角的箭头。

Expand embedded objects list

Alternatively, you can right-click on the document you want to expand and select Expand all fields from the drop-down menu.或者,您可以右键单击要展开的文档,然后从下拉菜单中选择“展开所有字段”。

Json View

To expand individual documents, follow the instructions below.要展开单个文档,请按照以下说明进行操作。

To toggle the expansion of embedded objects and array elements, hover over the target document and click the top arrow on the left side of the document.要切换嵌入式对象和数组元素的展开,请将鼠标悬停在目标文档上,然后单击文档左侧的顶部箭头。

To expand individual objects and arrays, click the arrow to the left of the desired field.要展开单个对象和数组,请单击所需字段左侧的箭头。

Expand embedded objects JSON

Alternatively, you can right-click on the document you want to expand and select Expand all fields from the drop-down menu.或者,您可以右键单击要展开的文档,然后从下拉菜单中选择“展开所有字段”。

Table View

To view nested object fields and array elements, hover your cursor over a field with a value type of Object or Array and click the button with outward-pointing arrows which appears on the right side of the field.要查看嵌套的对象字段和数组元素,请将游标悬停在值类型为ObjectArray的字段上,然后单击字段右侧显示的向外指向箭头的按钮。

Compass opens a new tab in the Table View corresponding to the nested element.Compass在表格视图中打开一个与嵌套元素对应的新选项卡。

View nested elements in Table view

The following example displays the address object nested within the restaurants collection documents. The new tab displays the five properties of the address object:以下示例显示了嵌套在restaurants集合文档中的address对象。新选项卡显示地址对象的五个属性:

Nested documents

To return to the original table display, click on the first tab in the Table View which displays the name of your collection.要返回原始表显示,请单击“表视图”中显示集合名称的第一个选项卡。

Copy Documents to Clipboard将文档复制到剪贴板

List View

To copy a document to your clipboard, hover over the document and click the Copy icon:要将文档复制到剪贴板,请将鼠标悬停在文档上,然后单击“复制”图标:

Copy Document from List View

You can also right-click on the document and select Copy document from the drop-down menu.您还可以右键单击文档,然后从下拉菜单中选择“复制文档”。

Additionally, if you right-click a specific field or value, you can copy that field/value pair by selecting Copy field & value from the drop-down menu.此外,如果右键单击特定字段或值,则可以通过从下拉菜单中选择“复制字段和值”来复制该字段/值对。

Json View

To copy a document to your clipboard, hover over the document and click the Copy icon:

Copy Document from JSON View

You can also right-click on the document and select Copy document from the drop-down menu.您还可以右键单击文档,然后从下拉菜单中选择“复制文档”。

Table View

To copy a document to your clipboard, hover over the document and click the Copy icon:要将文档复制到剪贴板,请将鼠标悬停在文档上,然后单击“复制”图标:

Copy Document from Table View

Encrypted Fields加密的字段

List View

Compass obscures document fields encrypted with Field-Level Encryption (FLE). Compass displays the values of these fields as a series of asterisks.Compass模糊了使用字段级加密(FLE)加密的文档字段。Compass将这些字段的值显示为一系列星号。

Encrypted field in list view

If your deployment is connected using In-Use Encryption and your collection is configured with Queryable Encryption, you can toggle the In-Use Encryption connection option.如果部署是使用“使用中加密”连接的,并且集合配置了“可查询加密”,则可以切换“使用中加密”连接选项。

  • When In-Use Encryption is enabled, you can modify and view the encrypted values and fields.启用“使用中加密”后,您可以修改和查看加密的值和字段。
  • When In-Use Encryption is disabled, Compass displays the values of these fields as a series of asterisks.禁用“使用中加密”时,Compass会将这些字段的值显示为一系列星号。
Json View

Compass obscures document fields encrypted with Field-Level Encryption (FLE). Compass displays the values of these fields as a series of asterisks.Compass模糊了使用字段级加密(FLE)加密的文档字段。Compass将这些字段的值显示为一系列星号。

If your deployment is connected using In-Use Encryption and your collection is configured with Queryable Encryption, you can toggle the In-Use Encryption connection option.如果部署是使用“使用中加密”连接的,并且集合配置了可查询加密,则可以切换“使用中加密”连接选项。

  • When In-Use Encryption is enabled, you can modify and view the encrypted values and fields.启用“使用中加密”后,您可以修改和查看加密的值和字段。
  • When In-Use Encryption is disabled, Compass displays the values of these fields as a series of asterisks.禁用“正在使用的加密”时,Compass会将这些字段的值显示为一系列星号。
Table View

Compass obscures document fields encrypted with Field-Level Encryption (FLE). Compass displays the values of these fields as a series of asterisks.Compass模糊了使用字段级加密(FLE)加密的文档字段。Compass将这些字段的值显示为一系列星号。

Encrypted field in table view

If your deployment is connected using In-Use Encryption and your collection is configured with Queryable Encryption, you can toggle the In-Use Encryption connection option.如果部署是使用“使用中加密”连接的,并且集合配置了“可查询加密”,则可以切换“使用中加密”连接选项。

  • When In-Use Encryption is enabled, you can modify and view the encrypted values and fields.启用“使用中加密”后,您可以修改和查看加密的值和字段。
  • When In-Use Encryption is disabled, Compass displays the values of these fields as a series of asterisks.禁用“使用中加密”时,Compass会将这些字段的值显示为一系列星号。

View URLs in Browser在浏览器中查看URL

If your document contains a URL value, you can right-click the URL and select Open URL in browser to open the URL in your browser:如果文档包含URL值,您可以右键单击该URL,然后选择“在浏览器中打开URL”,在浏览器中打开该URL:

Right click to Open URL