managed_mongo 1.1.0 copy "managed_mongo: ^1.1.0" to clipboard
managed_mongo: ^1.1.0 copied to clipboard

outdatedDart 1 only

A wrapper for running a managed mongo instance from inside a Dart library or application.

Managed Mongo #

Managed Mongo is a simple wrapper for downloading and running a MongoDB server from inside a dart application.

Use Case 1: Utilizing a real MongoDB instance inside unit and integration tests #

import "package:unittest/unittest.dart";
import "package:managed_mongo/managed_mongo.dart";

main() {
  MongoDB mongodb;
  setUp(() async {
    var downloadUrl = "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.6.5.tgz";
    mongodb = new MongoDB(downloadUrl);
    await mongodb.start();
  });

  tearDown(() async {
    await mongodb.stop();
  });

  test("running flag updates when start and stop are called", () async {
    // ...your code that uses MongoDB here...
  });

Use Case 2: Automatic installation and creation of MongoDB on an end-user's machine #

import "package:managed_mongo/managed_mongo.dart"

main() async {
    var downloadUrl = "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.6.5.tgz";
    MongoDB mongodb = new MongoDB(downloadUrl);
    await mongodb.start();
    // your code here
    int exitCode = await mongodb.stop();
    print("MongoDB completed with exit code: $exitCode");
}

Supported Archive Types #

The download url must point a properly encoded file with one of the following extensions:

  • .zip
  • .tar
  • .tar.gz
  • .tgz

All other file extensions will result in an error.

TODO #

  1. Further customization options (i.e. other command line flags)
  2. General code cleanup and refactoring
0
likes
0
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A wrapper for running a managed mongo instance from inside a Dart library or application.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, dart_commons, path

More

Packages that depend on managed_mongo