From 22035869ab029305fe850f24afe646f0cb8523fb Mon Sep 17 00:00:00 2001 From: Andrew Edwards Date: Thu, 7 May 2020 23:53:12 -0400 Subject: [PATCH] Update README.md --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 629f0b6..6830633 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ -# queues-mongo-driver +# QueuesMongoDriver -A description of this package. +## A MongoDB driver for Vapor Queues + +## Getting Started + +To install queues-mongo-driver add the following dependency to your `Package.swift`: + +`.package(url: "https://github.com/vapor-community/queues-mongo-driver.git", from: "1.0.0"),` + + +This driver depends on [MongoKitten](https://github.com/OpenKitten/MongoKitten) so to configure the driver we need an instance of a `MongoDatabase`. Ideally during app startup or in your `configure.swift`: + +```swift +import QueuesMongoDriver +import MongoKitten + +func configure(app: Application) throws { + let mongoDatabase = try MongoDatabase.lazyConnect("mongodb://localhost:27017/my-database", on: app.eventLoopGroup.next()) + + // Setup Indexes for the Job Schema for performance (Optional) + try app.queues.setupMongo(using: mongoDatabase) + app.queues.use(.mongodb(mongoDatabase)) +} +```