- node js version v20.11.0
- mongoDB client
- mongosh
- Go to program files --> MongoDB-->server--->bin Copy bin path and add it in enviornment feild
- Open Configuration file (mongo.config) set folowing
-
replication: replSetName: rs0
- open mongosh using command mongosh
- use folowing command
use admin
mongod --port 27017 --replSet rs0 --dbpath="C:\[give a folder name]\db0"
rs.initiate()
- In the Root folder create .env file and serviceAccountKey.json file (paste the credentials that you have created using firebase ,(make sure create service Account credentials) )
- Inside .env file paste this *MONGO_URL=mongodb://localhost:27017/apoorv?replicaSet=rs0
- Run npm init
- npm start