also update anon configs
parent
7dbdef906f
commit
ed7b30f512
|
@ -1,16 +1,18 @@
|
|||
db.config.find().forEach(function(o) {
|
||||
var sets = {};
|
||||
var unsets = {};
|
||||
['friend', 'hook', 'ai'].forEach(function(type) {
|
||||
if (!o[type]) return;
|
||||
sets[type + '.tm'] = o[type].k ? NumberInt(1) : NumberInt(0);
|
||||
sets[type + '.d'] = NumberInt(2);
|
||||
unsets[type + '.k'] = true;
|
||||
});
|
||||
db.config.update({
|
||||
_id: o._id
|
||||
}, {
|
||||
$set: sets,
|
||||
$unset: unsets
|
||||
[db.config, db.config_anon].forEach(function(coll) {
|
||||
coll.find().forEach(function(o) {
|
||||
var sets = {};
|
||||
var unsets = {};
|
||||
['friend', 'hook', 'ai'].forEach(function(type) {
|
||||
if (!o[type]) return;
|
||||
sets[type + '.tm'] = o[type].k ? NumberInt(1) : NumberInt(0);
|
||||
sets[type + '.d'] = NumberInt(2);
|
||||
unsets[type + '.k'] = true;
|
||||
});
|
||||
coll.update({
|
||||
_id: o._id
|
||||
}, {
|
||||
$set: sets,
|
||||
$unset: unsets
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue