Abstract
The MongoDB data storage structures are similar to those of a SQL relational database. A MongoDB database is similar to an SQL database. A table in an SQL database is a collection in MongoDB. A row in an SQL database is a document in MongoDB. A column in an SQL database is a field in MongoDB. MongoDB distribution includes an interactive shell called the Mongo shell. The Mongo shell provides database commands of different kinds including aggregation commands (for example, the count command finds the number of documents in a collection), collection commands (for example, the create command creates a collection), and administration commands (for example, the copydb command copies a database instance). The Mongo shell provides various JavaScript Mongo shell helper methods for data operations and administration. Some of the database commands have the equivalent Mongo shell helper methods, while others don’t. In this chapter we shall discuss how to access the Mongo shell and run database commands and JavaScript helper methods on a database, collection, or document.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Deepak Vohra
About this chapter
Cite this chapter
Vohra, D. (2015). Using the Mongo Shell. In: Pro MongoDB™ Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1598-2_2
Download citation
DOI: https://doi.org/10.1007/978-1-4842-1598-2_2
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-1599-9
Online ISBN: 978-1-4842-1598-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)