mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
module.add(user,problem,record)
This commit is contained in:
commit
d5b1f623f8
43 files changed
+5965
No files matched your search
@@ -0,0 +1,19 @@
|
||||
const
|
||||
Mongo = require('mongodb'),
|
||||
options = require('./lib/options');
|
||||
|
||||
async function run() {
|
||||
let mongourl = 'mongodb://';
|
||||
if (options.db.username) mongourl += options.db.username + ':' + options.db.password + '@';
|
||||
mongourl += `${options.db.host}:${options.db.port}/${options.db.name}`;
|
||||
let Database = await Mongo.MongoClient.connect(mongourl, { useNewUrlParser: true, useUnifiedTopology: true });
|
||||
let db = Database.db(options.db.name);
|
||||
await db.dropDatabase();
|
||||
console.log('Dropped');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
run().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in new issue
Block a user