Storing and retrieving data with MongoDB
Storing and retrieving data with MongoDB > show dbs local 0.03125GB test (empty) > show collections startup_log system.indexes users > db.createCollection('users') >db.users.insert({'name':'root','uid':'0001'}) >db.users.find() { "_id" : ObjectId("58b334b1f4d36fb19595a7a9"), "name" : "root", "uid" : "0001" } In this recipe, we will look at basic CRUD operations with MongoDB. We will learn how to create databases, store, retrieve, and update stored data. This is a recipe to get started with MongoDB. Getting ready Make sure that you have installed and configured MongoDB. You can also use the MongoDB installation on a remote server. How to do it… Follow these steps to store and retrieve data with MongoDB: Open a shell to interact with the Mongo server: $ mongo To open a shell on a remote serv er, use t...