The following is an example to insert a document in MongoDB using Compass GUI tool.
Follow These Steps
- Open MongoDB Compass and connect to it.
- On the left side under My Cluster, select the database.
- Then select the collection in which you want to insert the document.
- Then on the right side click on the Insert Document button, as shown in the below image.
- After that, an Insert Document window will pop up, and you will see an object id for the ID column will be showing already. Then you need to enter the field name and press TAB key to navigate to enter the VALUE for that field (no need to put a colon ":"), as shown in the below screenshot.
- After competing entries for the document, click on the Insert button to save it.
This way you can insert a document in MongoDB using Compass GUI tool.
- How to Install MongoDB with Compass in Windows?
- How to create a database in MongoDB Compass GUI?
- How to Create Collections in MongoDB?