prerequisite.
- download and instal mongodb in your remote computer.
- download mongDB compass(A GUI) to see all the existing database
MongoDB follows No-Sql dbms. Data stored in form of collection in JSON like Document.
For Example:
{
user:'user1',
message: 'My first comment',
dateCreated: new Date(2011,1,20,2,15),
like: 0
}
check version of mongoDB by the command.
mongod --version
Before adding any data in databse make sure to start your surver. By running the command.
"C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"
replace 4.2 with the version you have downloaded.
STEPS FOR ADDING DATA
- First of all load the data in the program.
- The data can be loaded using pandas or numpy module.
- Bring out the predefine functions in order to load the data in the correct form.
- If the data contain any null or nan field value then the value needs to be converted into the integer 0 value.
- 0 integer value will be treated as the nan values.
- Common examples of NoSQL database is mongodb database.
- Mongodb is the most famous NoSQL database.
- In order to add the data we need to convert the data into the list of dictinoary which contains all the field values and data coresponding to that values.
- Using insert_many() function all the values can be added into the server of the mongodb database