Storing a simple document in mongodb

This page describes how to store a simple document in mongodb.

Below and example how this could be done:

Create a mongo instance using

Connect to the jjccoding database:

Get the students collection where the documents will be stored

Create the to be stored document:

Store the created document in the collection:

To view the stored document start a mongodb client and type and execute the following:

It should return something like this:

Sources: store-student-in-mongodb

Leave a Reply

Your email address will not be published. Required fields are marked *