Database Connection using NODE JS example In my earlier article, you have learned how to create your first node js application and how to create node js web application. If you have not read it, I am suggesting you to read these two articles. Below are the link of these articles. http://java.gunustories.com/2018/06/create-first-node-js-application.html http://java.gunustories.com/2018/06/generate-node-js-web-application.html After creating a web application, you need to deal with database. So before writing node js script, you need to download and install MongoDB in your PC. To download MongoDB go to the https://www.mongodb.com/download-center?jmp=nav#community link. Before start writing node js database connection, please insure that MongoDB is running in your PC. Now open app.js file and write below configuration to connect with MongoDB. const MongoClient = require('mongodb').MongoClient var db MongoClient.connect('mongodb://localhost:27017/', (er...
Map.Entry Interface - Map.Entry Interface is used to hold the view of key-value pair from Map. Map interface has a method entrySet() which returns the Set object that holds the key value pair. You can iterate the key and value from getKey() and getValue(). You can also set value an element by the setValue() method. List of methods within the Map.Entry Interface - boolean equals(Object o) - This method is used to compares the specified object with this entry. If both are equal it return true otherwise return false. K getKey() - This method returns the key of map. V getValue() - This method returns the value of corresponding to this entry. int hashCode() - This method is used to return the hash code value for this map entry. V setValue(V value) - This method is used to set the values at corr...
Comments
Post a Comment