From 25daf2e87f2f24b5a628537f4c76af20ecde0bb7 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 10 May 2019 05:10:02 +0700 Subject: [PATCH] fix mongo script --- bin/mongodb/patron-since.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mongodb/patron-since.js b/bin/mongodb/patron-since.js index 05161a40cb..d95d7266c5 100644 --- a/bin/mongodb/patron-since.js +++ b/bin/mongodb/patron-since.js @@ -1,4 +1,4 @@ -var u = 'neio'; +var u = 'neio'.toLowerCase(); var since = new Date('2019-01-17'); function monthDiff(dateFrom, dateTo) { @@ -6,4 +6,4 @@ function monthDiff(dateFrom, dateTo) { (12 * (dateTo.getFullYear() - dateFrom.getFullYear())) } -db.user4.update({_id: u}, {$set: { 'plan.months': monthDiff(since, new Date()) + 1, 'plan.since': since}}); +db.user4.update({_id: u}, {$set: { 'plan.months': NumberInt(monthDiff(since, new Date()) + 1), 'plan.since': since}});