Mongo Driver for Fluent
Install the MongoDB server
For more instructions, check out https://docs.mongodb.com/master/administration/install-community/.
OS X
brew install mongodbUbuntu
sudo apt-get update
sudo apt-get install mongodbRun the MongoDB server
mongodConnecting to MongoDB with Fluent
You need to edit Config/fluent.json to define mongo as the underlying database technology to use as driver for Fluent:
{
"driver": "mongo"
}Creating a driver is done using the MongoDB Connection String URI Format. Initializing a MongoDriver such a URI will attempt a connection to MongoDB.
import MongoDriver
import Fluent
let driver = try MongoDriver("mongodb://localhost")
let db = Fluent.Database(driver)