The mongo shell is equivalent to the administration console used by relational databases. Connecting to the mongo shell is as easy as typing the following code:
$ mongo
Type this on the command line for standalone servers or replica sets. Inside the shell, you can view available databases simply by typing the following code:
$ db
Then, you can connect to a database by typing the following code:
> use <database_name>
The mongo shell can be used to query and update data into our databases. Inserting this document in the books collection can be done as follows:
> db.books.insert({title: 'mastering mongoDB', isbn: '101'})
WriteResult({ "nInserted" : 1 })
We can then find documents from a collection named books by typing the following:
> db.books.find()
{ "_id" : ObjectId("592033f6141daf984112d07c"...