Strata Gems: Try MongoDB without installing anything

An easy way to get started with a NoSQL database

Welcome to our series of Strata Gems. We’ll be publishing a new one each day all the way through to December 24.

Strata 2011Document store databases such as MongoDB and CouchDB offer a scalable way to store semi-structured data. If you’re looking for an easy way to get started, without the pain of installing either a single instance or a cluster of database servers, MongoDB is a good choice.

MongoDB lets you store and query data expressed as JSON documents. It offers conventional indexing, replication and lets you perform map-reduce jobs on database contents. You can get started from the comfort of your browser by heading over to the MongoDB web site and using the online “Try It Out” interface.

The MongoDB shell is an interactive JavaScript interpreter.

Interactive MongoDB shell
The MongoDB “Try It Out” browser-based shell

Here are a couple of sample JSON documents we’ll store in Mongo.

Now we’ll save them into a database called “characters” – created automatically when referenced – and query for all the documents in the database.

Let’s run a few more complex queries, finding the characters who have age equal to 31, and who have age greater than 30.

This is just a small taste of what you can do with MongoDB. To dive further, enter tutorial into the “Try It Out” interface and work through the steps, then download MongoDB and try it out on your own machine.

tags: , , ,