Please leave a star to show your support for the project.

Swift 3.1.0 License Build Status

MongoKitten

OpenKitten

Native MongoDB driver for Swift, written in Swift. This library does not wrap around the mongoc driver.

Requirements

  • A MongoDB server (local or online) running MongoDB 2.6 or above. (MongoDB 3.2 or 3.4 is recommmended)
  • Swift 3.1 or greater

Linux requries the libssl-dev library to be installed.

Swift 4.0

For Swift 4.0 you’ll need to put the package CryptoSwift in editable mode using: swift package edit CryptoSwift --revision develop

Setting up MongoDB

Install MongoDB for Ubuntu, macOS or any other supported Linux Distro.

Alternatively; make use of a DAAS (Database-as-a-service) like Atlas, MLab, Bluemix or any other of the many services.

Importing

Add this to your dependencies:

.Package(url: "https://github.com/OpenKitten/MongoKitten.git", majorVersion: 4)

And import MongoKitten in your project.

Building

Always compile MongoKitten in release mode for production and benchmarks. MongoKitten has proven to be 100-200x faster on release mode compared to debug compilation. And debug compilation is what Xcode and SPM use by default.

swift build -c release

Learn

Many articles on medium are listed here and here.

We host the MongoKitten documentation including dash docset here.

Community

Join our slack here and become a part of the welcoming community.

Learn more about contributing here.

Contributors are always welcome. Questions can be discussed on slack or in github issues. We also take part in the Contributor Covenant Code of Conduct.

Support

We’re accepting donations for our project here. We hope to set up a good test environment as well ad many docs, tutorials and examples.

Performance

MongoKitten’s is faster than other drivers. It is, however, not fully tested to MongoDB spec yet.

Driver Execution time
MongoKitten 4 525ms
Java (post JIT optimizations) 585ms
C 605ms
Ruby 1200ms
Java (pre JIT optimizations) 1205ms

License

MongoKitten is licensed under the MIT license.