Adding MongoProvider

Now, we need to add MongoProvider to our project by adding it to the package's dependencies and we also need to specify the module as a dependency in the Target section of App:

// swift-tools-version:4.0import PackageDescriptionlet package = Package(    name: "ShoppingListServer",    products: [        .library(name: "App", targets: ["App"]),        .executable(name: "Run", targets: ["Run"])    ],    dependencies: [        .package(url: "https://github.com/vapor/vapor.git",                       .upToNextMajor(from: "2.4.4")),        .package(url: "https://github.com/vapor/fluent-provider.git",                       .upToNextMajor(from: "1.2.0")),        .package(url: "https://github.com/ankurp/healthcheck-provider.git", .upToNextMajor(from: "1.0.0")), .package(url: "https://github.com/vapor-community/mongo-provider.git", ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.