after creating two replica set e.g 2717, 2718
do these things on terminal
• After that open a new command prompt and run the primary
node,
→ mongosh --port 2717
After that do
→ rs.status()
It will say not yet configured(see the video for reference) then,
→ rs.initiate() ,then
→ rs.add(“localhost:2718”)
this will do the configuration, you can check it by using
rs.status()
• Now run this connection string in MongoDb comapass to connect
to the cluster -
mongodb://localhost:2717,localhost:2718/backend?replicaSe
t=myReplSet