Search code examples
swiftmongodbvapormongodb-replica-setmongodb-atlas

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?


Solution

  • 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.