mongod --dbpath [ Path of the folder where I want my DB ]
mongo --host [ Adress and port where mongod listens on ]
mongod --dbpath [ Path of the database ] --shutdown
Once in the MongoDB shell
use [ Name of the database ]
db # Just to check
Once in the MongoDB shell
db.[table].insert([ JSON format informations ])
Note
:
- "db" is the keyword that we will use, that's why we have to use the use command before, just to select the database
- The table (which is not really a table because NoSQL) doesn't has to be defined, it will then be added automatically
[name of the variable] = [JSON format informations, that can be an array of course]
db.[table].insert([name of the variable]);
db.[table].find().pretty()