How to insert record into Mongodb

Posted in Tutorials

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

Continuing from our last tutorial, in this tutorial we will insert a record into our firstdb database into our highlowtemp collection whose data looks like this …

mongolab database

mongolab database

In app.js, we create a document of similar structure of a “New State” with some fake temperatures to be inserted…

inserting into mongodb

inserting into mongodb

And the output looks like this …

inserted output

inserted output

And if you check MongoLab, you would see new record in place.