Mongoose unable to connect with Mongo Standalone replicaSet

Detail about the issue.


I have converted my MongoDB instance to a standalone ReplicaSet using the following config.

systemLog:
destination: file
path: /opt/homebrew/var/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /opt/homebrew/var/mongodb
net:
bindIp: 127.0.0.1
replication:
replSetName: “rs0”
security:
authorization: “enabled”
keyFile: /Users/username/mongodb.key


Using the following Mongo URI to connect to my MongoDB instance

"mongodb://username:password@127.0.0.1:27017/dbName?authSource=admin&replicaSet=rs0"

using the URI I can connect to my MongoDB through Studio3T but when I use this URI in my Node app through Mongoose it never connects, nor gives any error.


Following are the Screenshots for rs.status() output displaying details of member
member data from rs.status


Additional details.
NodeJs version: v14.19.1
Mongoose version: 6.3.2
MongoDB version: 5.0.7