mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-25 10:23:09 +02:00
Improve performance
This commit is contained in:
parent
8028c85c67
commit
e4e668b327
1 changed files with 5 additions and 1 deletions
|
@ -20,11 +20,15 @@ export default (
|
||||||
: new mongo.ObjectID(note);
|
: new mongo.ObjectID(note);
|
||||||
|
|
||||||
// Remove document
|
// Remove document
|
||||||
await NoteUnread.remove({
|
const res = await NoteUnread.remove({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
noteId: noteId
|
noteId: noteId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (res.deletedCount == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const count1 = await NoteUnread
|
const count1 = await NoteUnread
|
||||||
.count({
|
.count({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
|
Loading…
Reference in a new issue