Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
function removeCollection(inputCollection, callback) {
var db;
database.connect(databaseLocation, function (err, dbase) {
if (err) {
throw err;
}
db = dbase;
db.collection(inputCollection, function (err, coll) {
if (err) {
throw err;
}
coll.remove({}, function (err, results) {
if (err) {
throw err;
}
db.close();
callback();
});
});
exports.connectDB = function(callback){
if (process.env.NODE_ENV == 'test') {
Db.connect('mongodb://localhost/microcommunity_test', function(err, database) {
callback(err, database);
});
} else {
Db.connect('mongodb://localhost/microcommunity', function(err, database) {
callback(err, database);
});
}
}