Hi @Daniele_Leoni. A couple of considerations:
- when you configure a replica set within docker that way, when the driver (Compass uses node.js) connects, it will try to discover the nodes of the replica set. MongoDB will return 127.0.0.1:27017, and that is what Compass will try to connect to. You can avoid this problem by adding
?directConnection=true to the connection string in Compass, or in the advanced connection options select Direct Connection. That should work.
- Instead of initializing the replica set manually in your compose file, you could consider using the
mongodb/mongodb-atlas-local image documented here. That will give you a 1-node replica set out of the box, and includes full-text search and vector search capabilities with Atlas Search and Atlas Vector Search.
1 Like