A Mongo DB Accessor for the danake-sw persistence framework. Currently tested on OSX and Ubuntu 16.04.
- Install the MongoDb C Driver (on Ubuntu 16.04 it appears necessary to install the latest version from tarball rather than using the version available through apt-get).
- Add the following your project's Package.swift package description:
.Package(url: "https://github.com/neallester/danake-mongo.git, .branch("master")),
import danakeMongo let logger = ConsoleLogger() let mongoAccessor = try MongoAccessor(dbConnectionString: "connectionString", databaseName: "dbName", logger: logger)
The mongoAccessor object may be used to create a Danake Framework Database (see danake-sw for details).
See class MongoAccessor for additional initialization options.
Important Note: Call MongoSwift.cleanup() exactly once at end of application execution.