Swiftpack.co - Package - vapor-community/mongo-driver

Mongo Driver for Fluent

Swift Slack Status

Install the MongoDB server

For more instructions, check out https://docs.mongodb.com/master/administration/install-community/.

OS X

brew install mongodb

Ubuntu

sudo apt-get update
sudo apt-get install mongodb

Run the MongoDB server

mongod

Connecting 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)

Github

link
Stars: 20
Help us keep the lights on

Used By

Total: 0

Releases

2.2.1 - Oct 17, 2017

  • Support outer joins

2.2.0 - Oct 12, 2017

  • Swift 4.0 package description
  • More aggregate types
    • min
    • max
    • sum
    • average
  • Queries with multiple joins
  • Queries on siblings
  • Bulk updates and deletes based with filters (also on joins)

2.1.2 - Oct 6, 2017

  • Fixed counting aggregated results

2.1.0 - Aug 28, 2017

  • Added support for subsets
  • Fixed saving arrays

2.0.0 - May 18, 2017

New:

  • MongoDB's Fluent Driver has been updated to Fluent 2 and MongoKitten 4 🎉
  • Many more Fluent features are supported.

Special thanks to the creator of MongoKitten @Joannis who updated the driver.