How to create replica set in mongoDb new version above 6.0 in windows

511 views Asked by At

how to create replication in mongoDb (node js) in latest version.

i was trying mongodb documentation https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/

i used this command to run instance as replication:

mongod --port 27017 --replSet rs0 --dbpath="C:\data\db0"

then in mongosh

run rs.initiate() command and getting error as replica set not found

1

There are 1 answers

0
AudioBubble On BEST ANSWER

Download mongosh new version and in mongo shell try to run these commands

rs.initiate();
rs.conf();