Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

marshallformula/mongoose-persistent-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-persistent-connector

DEPRECATED

The functionality that this module represents exists natively in the mongo driver by utilizing the retryMiliSeconds and numberOfRetries options passed to the connect method.


mongoose-persistent-connector is a simple connection utility for mongoose/mongodb connections. It's a simple wrapper around the connection that will re-attempt connecting to the database upon when it disconnects on a specified retry interval.

Example:

var connector = require('mongoose-persistent-connector');

connector.connect('mongodb://127.0.0.1', {log: true, retryInterval: 6000});

mongoURL

The url of the mongodb database. Defaults to mongodb://127.0.0.1.

connectionOpts

  • log Set this to true to output log connection messages messages. Defaults to true.

  • retryInterval Number of milliseconds to wait between connection attempts. Defaults to 6000.

mongoOpts

  • MongodDB connection options passed to mongoose.connect().

About

mongoose-persistent-connector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published