-
-
Notifications
You must be signed in to change notification settings - Fork 956
Open
Description
Hi All,
I'm using version 1.0 on a project and I have a route that starts a PROMISE whenever a request is made.
new Promise(async (_) => {
...
...
await db.get(collection).find(filter).assign(obj).write(function(err) {
if(err) throw err;
}).then((result) => {
console.log('Updated');
console.log(result);
}
});
...
...
.catch(err => {
console.error(err);
})
RESULT shows the updated obj, but when checking the data, if for example 6 requests were sent at the same time, only 2 or 3 were actually updated.
It seems that one PROMISE overwrites the other. While the promise A has the update for X, the promise B only has the update for Y and the last to write it, will set the final value.
How can I get it updated from all PROMISES?
Thanks ;)
Metadata
Metadata
Assignees
Labels
No labels