index.js
function JugglingStore(schema, options) {
		options = options || {};
		Store.call(this, options);
		this.maxAge = options.maxAge || defaults.maxAge;
		var coll = this.collection = schema.define('Session', {
			sid: {
				type: String,
				index: true
			},
			expires: {
				type: Date,
				index: true
			},
			session: schema.constructor.JSON
		}, {
			table: options.table || defaults.table
		});

		coll.validatesUniquenessOf('sid');

		// destroy all expired sessions after each create/update
		coll.afterSave = function(next) {
			coll.iterate({where: {
				expires: {lte: new Date()}
			}}, function(obj, nexti, i) {
				obj.destroy(nexti);
			}, next);
		};
	}
function JugglingStore(schema, options) {
		options = options || {};
		Store.call(this, options);
		this.maxAge = options.maxAge || defaults.maxAge;
		var coll = this.collection = schema.define('Session', {
			sid: {
				type: String,
				index: true
			},
			expires: {
				type: Date,
				index: true
			},
			session: schema.constructor.JSON
		}, {
			table: options.table || defaults.table
		});

		coll.validatesUniquenessOf('sid');

		// destroy all expired sessions after each create/update
		coll.afterSave = function(next) {
			coll.iterate({where: {
				expires: {lte: new Date()}
			}}, function(obj, nexti, i) {
				obj.destroy(nexti);
			}, next);
		};
	}
function JugglingStore ( schema , options ) { options = options || { } ; Store . call ( this , options ) ; this . maxAge = options . maxAge || defaults . maxAge ; var coll = this . collection = schema . define ( 'Session' , { sid : { type : String , index : true } , expires : { type : Date , index : true } , session : schema . constructor . JSON } , { table : options . table || defaults . table } ) ; coll . validatesUniquenessOf ( 'sid' ) ; // destroy all expired sessions after each create/update coll . afterSave = function ( next ) { coll . iterate ( { where : { expires : { lte : new Date ( ) } } } , function ( obj , nexti , i ) { obj . destroy ( nexti ) ; } , next ) ; } ; }
Initialize JugglingStore with the given `options`.

@param {JugglingDB.Schema} schema
@param {Object} options
@api public
Initialize JugglingStore with the given options .