GithubHelp home page GithubHelp logo

cuba / mongokitten Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orlandos-nl/mongokitten

0.0 1.0 0.0 5.04 MB

Native MongoDB driver for Swift, written in Swift

Home Page: http://openkitten.org

License: MIT License

Swift 100.00%

mongokitten's Introduction

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

Swift 3.1.0 License Build Status

MongoKitten

OpenKitten

MongoKitten is a native, production-ready MongoDB driver written in pure Swift. It is the fastest MongoDB driver available on any platform, while providing a great Swift API that is a joy to use.

Core features

  • Production ready
  • No complex setup procedure, just import and go
  • Extremely performant ๐Ÿš€
  • Pure Swift
  • Great API
  • Fast with support for new MongoDB and Swift features and versions

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.

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, IBM Cloud or any other of the many services.

Getting started

Add MongoKitten to your Package.swift:

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

Swift 4: .package(url: "https://github.com/OpenKitten/MongoKitten.git", from: "4.0.0")

For Swift 4 you also need to add MongoKitten to your target's dependencies and optionally ExtendedJSON for people using that:

.target(name: "MyTarget", dependencies: ["MongoKitten"])

After a swift package update, you can now use MongoKitten:

import MongoKitten

let myDatabase = try MongoKitten.Database("mongodb://localhost/my_database")
let myCollection = myDatabase["my_collection"]

for document in try myCollection.find("foo" > 42) {
    // do something with document
}

For more information on how to use MongoKitten, visit the documentation.

Building for performance

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. Both Xcode and SPM use debug compilation 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 as many docs, tutorials and examples.

Performance

MongoKitten is faster than other MongoDB drivers.

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.

mongokitten's People

Contributors

callo90 avatar gabriellanata avatar ianpartridge avatar joannis avatar justinm1 avatar lgaches avatar loganwright avatar obbut avatar paulrolfe avatar readmecritic avatar sujaykakkad avatar valeriomazzeo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.