Mongodb 简明教程

Working with RockMongo

RockMongo 是一款 MongoDB 管理工具,您可以使用它来管理服务器、数据库、集合、文档、索引以及更多内容。它提供了非常用户友好的方式来读取、写入和创建文档。它类似于用于 PHP 和 MySQL 的 PHPMyAdmin 工具。

RockMongo is a MongoDB administration tool using which you can manage your server, databases, collections, documents, indexes, and a lot more. It provides a very user-friendly way for reading, writing, and creating documents. It is similar to PHPMyAdmin tool for PHP and MySQL.

Downloading RockMongo

您可以从此处下载最新版的 RockMongo: https://github.com/iwind/rockmongo

You can download the latest version of RockMongo from here: https://github.com/iwind/rockmongo

Installing RockMongo

下载后,您可以将软件包解压缩到服务器根文件夹中,并将提取的文件夹重命名为 rockmongo 。打开任意 Web 浏览器,并从 rockmongo 文件夹中访问 index.php 页面。分别输入 admin/admin 作为用户名/密码。

Once downloaded, you can unzip the package in your server root folder and rename the extracted folder to rockmongo. Open any web browser and access the index.php page from the folder rockmongo. Enter admin/admin as username/password respectively.

Working with RockMongo

现在我们将了解可以在 RockMongo 中执行的一些基本操作。

We will now be looking at some basic operations that you can perform with RockMongo.

Creating New Database

要创建新数据库,请单击 Databases 选项卡。单击 Create New Database 。在下一个屏幕上,提供新数据库的名称,然后单击 Create 。您将看到在左面板中添加了一个新数据库。

To create a new database, click Databases tab. Click Create New Database. On the next screen, provide the name of the new database and click on Create. You will see a new database getting added in the left panel.

Creating New Collection

要在数据库内创建新集合,请从左面板中单击该数据库。单击顶部的 New Collection 链接。提供所需的集合名称。不必担心 Is Capped、Size 和 Max 的其他字段。单击 Create 。系统将创建一个新集合,您将在左面板中看到它。

To create a new collection inside a database, click on that database from the left panel. Click on the New Collection link on top. Provide the required name of the collection. Do not worry about the other fields of Is Capped, Size and Max. Click on Create. A new collection will be created and you will be able to see it in the left panel.

Creating New Document

要创建新文档,请单击想要在其中添加文档的集合。当您单击某个集合时,您将可以看到该集合内列出的所有文档。要创建新文档,请单击顶部的 Insert 链接。您可以采用 JSON 或数组格式输入文档数据,然后单击 Save

To create a new document, click on the collection under which you want to add documents. When you click on a collection, you will be able to see all the documents within that collection listed there. To create a new document, click on the Insert link at the top. You can enter the document’s data either in JSON or array format and click on Save.

Export/Import Data

要导入/导出任意集合的数据,请单击该集合,然后单击顶部面板中的 Export/Import 链接。按照后续说明,以 zip 格式导出数据,然后导入同一 zip 文件以重新导入数据。

To import/export data of any collection, click on that collection and then click on Export/Import link on the top panel. Follow the next instructions to export your data in a zip format and then import the same zip file to import back data.