feat: Add debug scripts to easilly get all pets/mounts/gear

This commit is contained in:
Blade Barringer
2016-03-15 12:47:24 -05:00
parent ed013ee34d
commit d62807f760
5 changed files with 117 additions and 0 deletions

19
debug-scripts/_helper.js Normal file
View File

@@ -0,0 +1,19 @@
import { MongoClient as mongo } from 'mongodb';
import config from '../config';
module.exports.updateUser = (_id, path, value) => {
mongo.connect(config.NODE_DB_URI, (err, db) => {
if (err) throw err;
let collection = db.collection('users');
collection.updateOne(
{ _id },
{ $set: { [`${path}`]: value } },
(updateErr, result) => {
if (updateErr) throw updateErr;
console.log('done updating', _id);
db.close();
}
);
});
}