router.post(\'/orders/finish\', function(req, res, next) {
var order_id = req.body.order_id;
var user_id = req.body.user_id;
var table_id = \'\';
var result = [];
m
You should wait for the update to complete before calling find
db.collection('tables').update({id: table_id, status: true}, {$set: {status: false}}, function(err, result) {
assert.equal(null, err);
var cursorTables = db.collection('tables').find({status: false});
cursorTables.forEach(function(doc, err) {
assert.equal(null, err);
resultTables.push(doc);
}, function() {
db.close();
});
});