Docs HomeMongoDB Compass

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 ViewJSON视图 (New in Compass 1.20)
Documents are shown as properly-formatted JSON objects. 文档显示为格式正确的JSON对象。In this view Compass uses extended JSON to display the data types of fields where appropriate.在这个视图中,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 you would like to use:使用“视图”按钮可以选择要使用的视图:


Documents list view
Note

JSON View is available starting in Compass 1.20.JSON视图从Compass 1.20开始提供。

Documents in JSON view
Documents in 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.对列进行重新排序是一种严格的外观更改,不会更改基础数据本身。

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

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

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

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 delays object nested within the airlines collection documents. 以下示例显示嵌套在airlines集合文档中的delays对象。The new tab displays the two properties of the delays object: international and domestic.

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将文档复制到剪贴板

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

Copy Document from List View

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

Copy Document from Table View

Encrypted Fields加密字段

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

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

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