Giter VIP home page Giter VIP logo

perfect-mongodb's Introduction

Perfect - MongoDB Connector 简体中文

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 4.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

NOTE: This package is deprecated in favour of the official Mongo Swift Driver. We advise users to switch to that package if possible.

--

This project provides a Swift wrapper around the mongo-c client library, enabling access to MongoDB servers.

This package builds with Swift Package Manager and is part of the Perfect project. It was written to be stand-alone and so does not require PerfectLib or any other components.

Ensure you have installed and activated the latest Swift 4.0 tool chain.

macOS Build Notes

This package requires the Homebrew build of mongo-c.

To install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To install mongo-c:

brew install mongo-c-driver

Linux Build Notes

Ensure that you have installed components below:

apt-get install libmongoc-dev libbson-dev libssl-dev

Building

Add this project as a dependency in your Package.swift file.

.package(url: "https://github.com/PerfectlySoft/Perfect-MongoDB.git", from: "3.0.0")

Documentation

Further information can be found at perfect.org.

perfect-mongodb's People

Contributors

davidsights avatar ericfromcanada avatar iamjono avatar keyofvv avatar kjessup avatar michaeltrimm avatar navartis avatar rockfordwei avatar sportlabsmike avatar taplin avatar thislooksfun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

perfect-mongodb's Issues

Code won't compile

Hello,
I just updated to Swift5 and I am not able to compile my project anymore. Indeed, I have a lot of type errors especially due to pointers. For example:

error: cannot convert value of type 'UnsafeMutablePointer<bson_t>' (aka 'UnsafeMutablePointer<_bson_t>') to expected argument type 'OpaquePointer?'

or

error: '&' used with non-inout argument of type 'OpaquePointer?'

Do you have any suggestion?
Thank you!

Add dependencies

Hi, i am trying to add MongoDB Dependencies in project , I am not sure where i am making mistake.,

i am using this `
import PackageDescription

let package = Package(
name: "SwiftBackend",
products: [
.library(name: "PerfectMongoDB", targets: ["PerfectMongoDB"])
],

dependencies: [
    // Dependencies declare other packages that this package depends on.
    .package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
    .package(url: "https://github.com/PerfectSideRepos/Perfect-CMongo.git", from: "0.0.0"),
    .package(url: "https://github.com/PerfectSideRepos/Perfect-CBSON.git", from: "0.0.0"),
    .package(url: "https://github.com/PerfectlySoft/PerfectLib.git", from: "3.0.0")
],
targets: [
    .target(
        name: "SwiftBackend",
        dependencies: ["PerfectHTTPServer" , "PerfectLib" , "PerfectMongoDB"]),
    ]

)
`

Please if somebody know how to configure it plz let me know

Shouldn't MongoQueryFlag's static properties be public?

public struct MongoQueryFlag: OptionSetType {
    ...
    static let None             = MongoQueryFlag(MONGOC_QUERY_NONE)
    static let TailableCursor   = MongoQueryFlag(MONGOC_QUERY_TAILABLE_CURSOR)
    static let SlaveOk          = MongoQueryFlag(MONGOC_QUERY_SLAVE_OK)
    static let OpLogReplay      = MongoQueryFlag(MONGOC_QUERY_OPLOG_REPLAY)
    static let NoCursorTimeout  = MongoQueryFlag(MONGOC_QUERY_NO_CURSOR_TIMEOUT)
    static let AwaitData        = MongoQueryFlag(MONGOC_QUERY_AWAIT_DATA)
    static let Exhaust          = MongoQueryFlag(MONGOC_QUERY_EXHAUST)
    static let Partial          = MongoQueryFlag(MONGOC_QUERY_PARTIAL)
}

What should I do after `make`?

I picked MongoDB for my swift-backend, everything works fine on Mac. But I have issue installing Perfect-MongoDB on my Ubuntu host. I have got *.o, *.so and *.swiftmodule files after make, what should I do thereafter?

getCollection does not return nil on non existing collection

Hi,
I am not sure whether this is an intended behaviour or not but I think the way getCollection() on MongoDatabase works is a bit strange.

The method's signature is the following:

func getCollection(name collectionName: String) -> MongoCollection?

Therefore, I expect to get a valid collection when collectionName corresponds to an existing collection in my database and nil when collectionName does not exist.

Instead of this, I indeed get the correct collection when collectionName is valid but when it's not I'm getting new empty collection that apparently does not even belong to my database.

Am I missing something from the doc or is there really a problem here?
Thank you in advance 😄

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.