Getting Started with Studio 3T开始使用Studio 3T

Posted on: 26/04/2018 (last updated: 21/12/2021) by Kathryn Vargas

Got Studio 3T downloaded and installed on your machine? 你的机器上下载安装了Studio 3T吗?Then let’s get started with MongoDB using Studio 3T.然后让我们使用Studio 3T开始MongoDB。

https://www.youtube-nocookie.com/embed/cKHumpkI7c8

Connect to MongoDB连接到MongoDB

Have your connection details ready准备好你的连接细节

Whether you’re MongoDB is hosted on-premise or through a cloud hosting service, the quickest way to connect to your database is to have a connection string ready.无论您是本地托管还是通过云托管服务托管MongoDB,连接数据库的最快方法就是准备好连接字符串。

mongodb://[username:password@]host1[:port1][,host2[:port2],…[,hostN[:portN]]][/[database][?options]]

The standard connection string or URI format标准连接字符串或URI格式

The good news is, cloud hosting services like MongoDB Atlas, Compose, mLab, ObjectRocket, and ScaleGrid readily provide this connection string, so all you need to do is make a few modifications (e.g. insert SSH and/or SSL details), and paste it into Studio 3T.好消息是,像MongoDB Atlas、Compose、mLab、ObjectRocket和ScaleGrid这样的云托管服务很容易提供这个连接字符串,所以您只需要做一些修改(例如插入SSH和/或SSL细节),然后将其粘贴到Studio 3T中。

Alternatively, you can also save the connection string as a URI file.或者,也可以将连接字符串另存为URI文件

Create a new connection创建新连接

Enter your connection string or upload your URI file in the Connection Manager following these steps.按照以下步骤在“连接管理器”中输入连接字符串或上载URI文件。

Choose between light or dark theme选择明暗主题

Choose between dark theme or the default light theme by going to Preferences > General and ticking the Enable dark theme checkbox.通过进入“首选项”>“常规”并勾选“启用深色主题”复选框,在深色主题或默认浅色主题之间进行选择。

Take a tour游览

Global toolbar全局工具栏

The global toolbar is available throughout your Studio 3T journey, providing you one-click access to the following features:在Studio 3T的整个旅程中,您都可以使用“全局工具栏”,只需单击一下即可访问以下功能:

Connection Tree连接树

On the left-hand side, you’ll always find the Connection Tree, which displays all your active MongoDB connections and their respective databases and collections.在左侧,您总能找到“连接树”,它显示所有活动的MongoDB连接及其各自的数据库和集合。

Avoid database mixups by color-coding your databases and collections.通过对数据库和集合进行颜色编码,避免数据库混淆。

Collection Tab“集合”选项卡

Double-click on any collection in the Connection Tree to open a collection tab.双击连接树中的任何集合以打开“集合”选项卡。

The Collection Tab is the starting point for using Studio 3T. “集合”选项卡是使用Studio 3T的起点。Here you can view, edit, and query your collection, and access other features.在这里,您可以查看、编辑和查询您的集合,并访问其他功能。

We highly encourage you to get familiar with the Collection Tab and read the full documentation here.我们强烈建议您熟悉“集合”选项卡,并阅读此处的完整文档。

Build your query构建你的查询

With Studio 3T, anyone can build a MongoDB query.使用Studio 3T,任何人都可以构建MongoDB查询。

It doesn’t matter if you don’t know the MongoDB query language, use SQL, or write JSON documents like a pro – there’s a feature that’s right for you.如果你不懂MongoDB查询语言,使用SQL,或者像专业人士一样编写JSON文档,这都无关紧要——有一个功能非常适合你。

Drag-and-drop拖放

If you have no knowledge of the MongoDB query language, you can still get some serious querying done with the Visual Query Builder.如果您不了解MongoDB查询语言,仍然可以使用“图形化查询生成器”完成一些重要的查询。

Simply drag and drop the fields you want to query into the builder, define your operators, and let the feature do the work – no MongoDB query syntax required.只需将要查询的字段拖放到构建器中,定义运算符,并让该功能完成工作——无需使用MongoDB查询语法。

Read about Visual Query Builder in full.全面阅读有关图形化查询生成器的信息。

mongo shell

Those familiar with the mongo shell will feel right at home with IntelliShell, which boasts an extra perk: rich, smart autocompletion which was even made more robust with Version 2018.4.熟悉mongo shell的人会对IntelliShell感到宾至如归,IntelliShell拥有一个额外的优势:丰富、智能的自动完成功能,在2018.4版中甚至变得更加强大。

View the full documentation on IntelliShell here.在此处查看IntelliShell的完整文档。

SQL

If you’re a SQL veteran new to MongoDB, you can be just as productive with your SQL querying skills.如果您是MongoDB的SQL老手,那么您的“SQL查询”技能也同样高效。

Through SQL Query, you can write SQL statements and joins to query MongoDB.通过“SQL查询”,您可以编写SQL语句并连接到查询MongoDB。

You also get to see how your SQL queries translate to the MongoDB query language, which is a great learning tool.您还可以看到SQL查询如何转换为MongoDB查询语言,这是一个很好的学习工具。

Read about SQL Query in full here.

Aggregation pipeline聚合管道

For a better way of building aggregation queries (which even the MongoDB pros will appreciate), there’s the Aggregation Editor.为了更好地构建聚合查询(连MongoDB的专业人士都会喜欢),这里有“聚合编辑器”。

It lets you define aggregation pipeline operators and check inputs and outputs one stage at a time, so that you know your pipeline is accurate each step of the way.它允许您定义聚合管道运算符,并一次检查一个阶段的输入和输出,这样您就知道您的管道在过程中的每一步都是准确的。

View the full documentation on Aggregation Editor here.在此处查看聚合编辑器上的完整文档

View your results查看您的结果

https://www.youtube-nocookie.com/embed/eWWhQ0-1_u4

You’ve built your query – now it’s time to check the results.您已经构建了查询,现在是检查结果的时候了。

Studio 3T lets you view your data in three ways.Studio 3T允许您以三种方式查看数据。

Table View表格视图

View your data in the familiar spreadsheet format and enjoy features unique to Studio 3T like showing embedded fields, stepping into array-valued columns, showing/hiding columns, and more.以熟悉的电子表格格式查看数据,并享受Studio 3T独有的功能,如显示嵌入字段、进入数组值列、显示/隐藏列等。

Read about Table View in full here.这里阅读有关“表格视图”的全文。

Tree View图形视图

Tree View shows your data in hierarchies that you can expand or collapse as needed.“树形视图”以层次结构显示数据,您可以根据需要展开或折叠这些层次结构。

View the full documentation on Tree View here.这里查看“树形视图”的完整文档。

JSON View视图

Go old school and view your collection as JSON documents, complemented by a built-in JSON editor that validates your syntax as you go.走老路,把你的集合看作JSON文档,再加上一个内置的JSON编辑器,可以在运行时验证你的语法。

View the full documentation on JSON View here.这里查看“JSON视图”的完整文档。

Query Code查询代码

In addition to viewing results, you can also see how your MongoDB, SQL, or aggregation queries translate to JavaScript (Node.js), Java (2.x and 3.x driver API), Python, C#, PHP, Ruby, and the mongo shell language.除了查看结果,您还可以查看MongoDB、SQL或聚合查询如何转换为JavaScript(Node.js)、Java(2.x和3.x驱动程序API)、Python、C#、PHP、Ruby和mongo shell语言。

Learn more about Query Code.了解有关查询代码的更多信息。

Explore your collections探索你的集合

Use Studio 3T’s many advanced features to dive deeper into your data.使用Studio 3T的许多高级功能可以深入了解您的数据。

Discover schema outliers发现模式异常值

Find documents with missing fields, spot incorrect fields like duplicates and misspellings, and incorrect field types.查找缺少字段的文档,发现重复和拼写错误等不正确的字段,以及不正确的字段类型

Visualize your schema图形化你的模式

With charts like value histograms, top values, and date distributions, visualizing your data can help teams glean important trends and insights.通过值直方图顶值日期分布等图表,可视化数据可以帮助团队集合重要的趋势和见解。

Compare and sync collections比较和同步集合

Use Data Compare and Sync to compare any two MongoDB collections across different databases and servers and sync differences as needed.使用数据比较和同步来比较不同数据库和服务器上的任意两个MongoDB集合,并根据需要同步差异。

New to MongoDB? MongoDB新手?Get the breakdown in our Getting Started with MongoDB guide. MongoDB入门指南中获取详细信息。Or if you’re already a Studio 3T pro, hone your skills and check out our latest MongoDB tutorials.或者,如果您已经是Studio 3T专业人士,请磨练您的技能,并查看我们最新的MongoDB教程