Commanding MongoDB

MongoDB comes with an interactive shell, which we have already used briefly in the previous chapter. To refresh your memory, after starting the MongoDB daemon by typing mongod, you access the shell in a separate terminal window by typing mongo.

Primarily, you will be accessing MongoDB using native code in your application. However, understanding the MongoDB shell is invaluable to using it. There will be times when you want to access the shell directly, particularly for debugging. You may also need to manage a MongoDB instance in the cloud.

You should have a good grasp of the MongoDB shell.

Getting information

One of the most important things you can do in the MongoDB shell is to manage your databases. Getting meta information out ...

Get Mastering JavaScript Single Page Application Development 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.