How to use the monk.apply function in monk

To help you get started, we’ve selected a few monk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vadimdemedes / mongorito / build / mongorito.js View on Github external
Mongorito.connect = function connect() {
    for (var _len = arguments.length, urls = Array(_len), _key = 0; _key < _len; _key++) {
      urls[_key] = arguments[_key];
    }

    // convert mongo:// urls to monk-supported ones
    urls = urls.map(function (url) {
      return url.replace(/^mongo\:\/\//, "");
    });

    var db = monk.apply(null, urls);

    // if there is already a connection
    // don't overwrite it with a new one
    if (!this.db) this.db = db;

    return db;
  };

monk

The wise MongoDB API

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis