How to clear MongoDB Shell console

We are going to see how to clear MongoDB Shell console. There are two methods to clear mongo shell on Linux and Windows operating systems.

How to clear MongoDB Shell console on Linux and Windows:

Below two methods are used to clear the mongo shell console on Linux and Windows operating systems.
Continue reading How to clear MongoDB Shell console

Step by Step MongoDB Replication setup on Windows

In this article, we will see Step by Step MongoDB Replication setup on Windows. We are going to add 1 Primary and 2 Secondary servers to replica Set.

What is replication?
Replication is a way of keeping identical copies of data on multiple servers and it is recommended for all production deployments.

Step by Step MongoDB Replication setup on Windows1
Continue reading Step by Step MongoDB Replication setup on Windows

MongoDB exception: connect failed

When tried to connect to MongoDB server, recieved the error: “MongoDB exception: connect failed”. This error occurs if MongoDB server is offline or It may be connecting with default port 27017.

MongoDB shell version v4.0.10 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb 2019-07-09T22:18:34.660-0700 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:344:17 @(connect):2:6 exception: connect failed

Reason:

Possible reason check the MongoDB server is up and running fine or not. In my case this error came because MongoDB server is down.

MongoDB exception connect failed

Solution 1:
Continue reading MongoDB exception: connect failed