lifetime patron mongo script
This commit is contained in:
parent
0306b473cc
commit
4a889e3e83
14
bin/mongodb/patron-lifetime.js
Normal file
14
bin/mongodb/patron-lifetime.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
var userId = 'shork'.toLowerCase();
|
||||
|
||||
var prev = db.user4.findOne({_id:userId}).plan;
|
||||
|
||||
db.user4.update({_id:userId},{$set:{plan:{
|
||||
months:NumberInt(prev.months || 1),
|
||||
active:true,
|
||||
since: prev.since || new Date()
|
||||
}}})
|
||||
|
||||
db.plan_patron.update({_id:userId}, {
|
||||
lastLevelUp: new Date(),
|
||||
lifetime: true
|
||||
}, {upsert:true});
|
Loading…
Reference in a new issue