Hiii!, Im trying to connect to my mongoDB service that is currently a replica set of a single primary server, I need this in order to use changeStreams.
The problem is that I get this “::1 ECONNREFUSED” , but I am not using the “localhost” syntax. Besides, I have another Python FastAPI running at the same time that connects to the MongoDB with no problems. So I dont know why Node cant stablish a connection. I have been days trying to connect but I can’t. Any help will be appreciated.
Error trace:
When connecting to a replicaset the hosts in the connection strings are a seed list.
The client discovers the rest of the hosts in the replicaset from the first seed node it can connect to and will then connect to the primary.
The hostnames in the replicaset configuration are the ones that will be used after the initial discovery. These are the hostname provided in rs.initiate() or rs.add().