This question has already been answered:
- Loss of context call 5 responses
I switched to mongoDB and it turned out that I need to write the found data to this.buyer
object, but this does not work. How to do it correctly and how to call after writing a function?
PlayerTracker.prototype.updateBuyers = function() { if (!db) return; this.buyer = {}; // work this.updateData(); // work db.collection("buyers").findOne({uuid: this._uuid}, function(err, b) { if (err) throw err if (!b) return; this.buyer = b; // dont work this.updateData(); // dont work }); }