Connecting with MongoDB is as simple as adding a MongoDB database provider to our Vapor application and telling Fluent to use mongodb as the database driver. A database driver allows an application to connect to the database and act as an adapter, which lets Fluent use a standard API to connect with different types of databases. The Fluent module also includes a memory and SQLite database driver and the API template defaults to using the in-memory database driver. We need to update this to start using the mongodb driver, so that we can connect with the mongodb server running locally on our machine.
The following is a table listing some of the popular databases that are supported, along with the config value for the driver to be used by Fluent:
Type | Fluent Config Value | Package |
Class
|
Memory | memory | FluentProvider | Fluent.MemoryDriver |
SQlite | sqlite... |