# Insert a Document into a Collection

In 
Published 2022-12-03

This tutorial explains to you how you can insert a document into a MongoDB collection.

MongoDB is an open-source (written in C++) document-oriented database and leading NoSQL database.

MongoDB stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time

MongoDB is free and open-source, published under the GNU Affero General Public License.

The document model maps to the objects in your application code, making data easy to work with.

Ad hoc queries, indexing, and real time aggregation provide powerful ways to access and analyze your data.

MongoDB is a distributed database at its core, so high availability, horizontal scaling, and geographic distribution are built in and easy to use.

In order to insert a new document into a MongoDB collection you can use a GUI named "Compass":

Click on the collection you want to use and after that click on "INSERT DOCUMENT".

Input the information for that document and after that click on "INSERT" button.

You will see that the new document JSON-like is added in that MongoDB collection. If you want you can view that document as a "table". Click on TABLE button and you will see the following: