From 2e3320eb5cebe07d3dfe1906cb92baa8374cee14 Mon Sep 17 00:00:00 2001 From: Cedric Hoelzl Date: Wed, 1 Jul 2020 11:11:56 +0200 Subject: [PATCH] kk --- db.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db.js b/db.js index ceb7a73..6f258de 100644 --- a/db.js +++ b/db.js @@ -41,11 +41,15 @@ module.exports = function(name){ }; this.set_v = function(cid,v){ - return this.db.find({id:cid}).set('tracking',v).write(); + return new Promise((resolve, reject)=>{ + resolve(this.db.find({id:cid}).set('tracking',v).write()); + }); }; this.get_v = function(cid){ - return this.db.find({id:cid}).get('tracking').value(); + return new Promise((resolve, reject)=>{ + resolve(this.db.find({id:cid}).get('tracking').value()); + }); } return this;