简体   繁体   中英

How to connect vapor to mongodb atlas

So I have a vapor \\ fluent app that works fine with local mongo instance, here's current mongo.json :

{
    "database" : "vapor",
    "port" : "27017",
    "host" : "127.0.0.1",
    "user" : "",
    "password" : ""
}

I've deployed a free MongoDB Atlas 3 replica set and I wonder how do I connect the app to it?

  • Check that your mongod instance is listening on the necessary network interfaces
  • Check that your firewall is open and you can connect to the mongod process from your application node
  • Check that your mongod is secure, ie you can connect only with known credentials
  • In the application's mongo.json:
"host": "replica_set_name/first_RS_node_address, second_RS_node_address, third_RS_node_address", 
"user": "your_user_name", 
"password": "wery_secret"

Fluent's MongoDB integration is using an outdated version of MongoKitten. Currently we're at MongoKitten 4. MongoKitten 1, which is being used in Fluent currently supports just a fraction of the features with a much worse performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM