Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @hapiness/mingo with all npm packages installed. Try it out:

require("@hapiness/core/package.json"); // @hapiness/core is a peer dependency. require("@hapiness/minio/package.json"); // @hapiness/minio is a peer dependency. require("@hapiness/mongo/package.json"); // @hapiness/mongo is a peer dependency. require("rxjs/package.json"); // rxjs is a peer dependency. var mingo = require("@hapiness/mingo")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@hapiness/mingo v2.3.0

Manage files using minio as file storage and mongodb for metadata

Hapiness

mingo module

This module helps you manage files with minio as file storage and mongodb for metadata.

It uses @hapiness/minio module and @hapiness/mongodb module.

Table of contents

Back to top

Usage

In your service:

@Injectable()
class MyService {

    constructor(private _mingoService) {}

    uploadFile(...) {
        this._mingoService.fromBucket('my_bucket').createFromStream(input, filename, 'image/jpeg', metadata);
    }
}

Change History

  • v2.0.0 (2019-02-15)
    • Breaking Change: Add bucket name in the file document
  • v1.4.0 (2019-02-14 🌹)
    • Added a new repository layer
    • Implemented a basic retry strategy for compatibility with comsodb error 429. (No impact on mongodb)
    • Added a new optional config option db.maxRetryAttempts: Number to determine max number of retry on cosmo retry strategy. Default is 9.
  • v1.3.0 (2019-01-30)
    • Update to @hapiness/core 1.6.x
    • Update to @hapiness/minio 2.0.1
  • v1.2.0 (2018-04-25)
    • Update to @hapiness/mongo 2.x
  • v1.1.2 (2018-02-14)
    • MingoModel now have an id exposed.
    • Fix when calling the toJson method but value returned by mongo is null.
  • v1.1.1 (2018-02-13)
    • Fix returned object, now doesn't include mongoose metadata
  • v1.1.0 (2018-01-30)
    • Update mingo model
    • Minor code updates
  • v1.0.0 (2018-01-18)
    • First release

Back to top

Maintainers

tadaweb
Julien Fauville Antoine Gomez Sébastien Ritz Nicolas Jessel Florent Bennani

Back to top

License

Copyright (c) 2017 Hapiness Licensed under the MIT license.

Back to top

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free