lib/mongostore.js
function MongoStore(connection, options) {
	if(arguments.length === 0 || typeof arguments[0] !== 'string') {
		throw new Error('A valid connection string has to be provided');
	}

	TokenStore.call(this);

	this._options = options || {};
	this._collectionName = 'passwordless-token';
	if(this._options.mongostore) {
		if(this._options.mongostore.collection) {
			this._collectionName = this._options.mongostore.collection;
		}
		delete this._options.mongostore;
	}

	this._uri = connection;
	this._db = null;
	this._collection = null;
}
function MongoStore(connection, options) {
	if(arguments.length === 0 || typeof arguments[0] !== 'string') {
		throw new Error('A valid connection string has to be provided');
	}

	TokenStore.call(this);

	this._options = options || {};
	this._collectionName = 'passwordless-token';
	if(this._options.mongostore) {
		if(this._options.mongostore.collection) {
			this._collectionName = this._options.mongostore.collection;
		}
		delete this._options.mongostore;
	}

	this._uri = connection;
	this._db = null;
	this._collection = null;
}
function MongoStore ( connection , options ) { if ( arguments . length === 0 || typeof arguments [ 0 ] !== 'string' ) { throw new Error ( 'A valid connection string has to be provided' ) ; } TokenStore . call ( this ) ; this . _options = options || { } ; this . _collectionName = 'passwordless-token' ; if ( this . _options . mongostore ) { if ( this . _options . mongostore . collection ) { this . _collectionName = this . _options . mongostore . collection ; } delete this . _options . mongostore ; } this . _uri = connection ; this . _db = null ; this . _collection = null ; }
Constructor of MongoStore
@param {String} connection URI as defined by the MongoDB specification. Please
check the documentation for details:
http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html
@param {Object} [options] Combines both the options for the MongoClient as well
as the options for MongoStore. For the MongoClient options please refer back to
the documentation. MongoStore understands the following options:
(1) { mongostore: { collection: string }} to change the name of the collection
being used. Defaults to: 'passwordless-token'
@constructor
Constructor of MongoStore