Using Robomongo to query MongoDB

Robomongo allows you to run any query against a MongoDB that would use the MongoDB command-line utility. This is a great way to test the queries that you'll write and to view the results.

Getting ready

To use this recipe, you need to have a working installation of MongoDB and have Robomongo installed.

How to do it…

You can use Robomongo to run any query against MongoDB that you would run at the command line. Use the following command to retrieve a single record:

db.getCollection('accidents').findOne()

You can view the results in multiple formats:

  • Tree mode
  • Table mode
  • Text mode

By default, Robomongo will show you the results in tree mode as shown in the following screenshot:

Get Python Business Intelligence Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.