Skip to main content

Posts

Showing posts from May, 2020

Current Server Discovery and Monitoring Engine is Deprecated

When building connection using mongoose you might get an error saying Current server discovery and monitoring engine is deprecated.  Error:  current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. So, basically two of the options need to be passed to the mongoose.connect method.  so these are:{ useNewUrlParser: true} and {useUnifiedTopology: true} See the example below: mongoose . connect ( "mongodb://localhost:27017/fruitsDB" , {    useNewUrlParser :   true ,    useUnifiedTopology :   true , }); Here, fruitsDB is the database name. Now, if you run your file say for example app.js, you will not that error again.

MongoDB Setup Guide for Beginner

Why MongoDB? Answer:  MongoDB stores data in flexible , JSON-like documents. Think like this is json database. What makes everything easy with json database is maping of the object. when you store anything in tables,rows and columns, accessing the data can be little bit challenging, and can be costly process  for your processor. But on the other hand, in the NoSql since everything is stored in mapping of key value pair, it is easier+faster and everything becomes easy  and simple with that. Scalability is challenging in mysql database.  This kind of scaling is super easy  in mongoDB . So it's getting high in demand on scalability. changing schema is so much easy. Drawbacks with mysql and other relational database is:  1) Hard to understand 2) Adding features harder 3) Inefficiant MongoDB solved this problems. who is using mongoDB? Amazon web services, Microsoft Azure, Google Cloud Platform a...