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;