lib/adapter.js
function MongoAdapter(mongooseConnection) {
  if (!(this instanceof MongoAdapter)) {
    return new MongoAdapter(mongooseConnection);
  }

  storj.StorageAdapter.call(this);

  if (mongooseConnection instanceof Storage) {
    this._model = mongooseConnection.models.Shard;
  } else {
    this._model = Shard(mongooseConnection);
  }
}
function MongoAdapter(mongooseConnection) {
  if (!(this instanceof MongoAdapter)) {
    return new MongoAdapter(mongooseConnection);
  }

  storj.StorageAdapter.call(this);

  if (mongooseConnection instanceof Storage) {
    this._model = mongooseConnection.models.Shard;
  } else {
    this._model = Shard(mongooseConnection);
  }
}
function MongoAdapter ( mongooseConnection ) { if ( ! ( this instanceof MongoAdapter ) ) { return new MongoAdapter ( mongooseConnection ) ; } storj . StorageAdapter . call ( this ) ; if ( mongooseConnection instanceof Storage ) { this . _model = mongooseConnection . models . Shard ; } else { this . _model = Shard ( mongooseConnection ) ; } }
Implements a MongoDB storage adapter for contract and audit management
@constructor
@extends {storj.StorageAdapter}
@param {Storage} mongooseConnection - The connection object from mongoose
Implements a MongoDB storage adapter for contract and audit management