vapor-community / mongo-provider

MongoDB Provider for Vapor
40 stars 18 forks source link

Is Readme uptodate? #18

Closed jkmathew closed 7 years ago

jkmathew commented 7 years ago

Readme says after adding package, to follow code

import Vapor
import VaporMongo

let drop = Droplet()
try drop.addProvider(VaporMongo.Provider.self)

But its giving error for me. Saying that no such module 'VaporMongo' My code that works is

import MongoProvider

let config = try Config()
try config.setup()

try config.addProvider(MongoProvider.Provider.self)

let drop = try Droplet(config)

Is anything wrong with my steps or should the read to be updated?

jkmathew commented 7 years ago

Also I had to add url key in the mongo.json config file. That is not mentioned in readme. :(

api-live commented 7 years ago

You're correct, the actual current module is 'MongoProvider'. The mongo.json file also expects all of the config values to be passed in the 'url' field. I went ahead and submitted a pull request to reflect these changes.

jkmathew commented 7 years ago

Closing issue since readme updated in #19