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

Swift 3.1.0 License Build Status



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


  • 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.


Add this to your dependencies:

.Package(url: "", majorVersion: 4)

And import MongoKitten in your project.


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


Many articles on medium are listed here and here.

We host the MongoKitten documentation including dash docset here.


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.


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.


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


MongoKitten is licensed under the MIT license.