Improve performance

This commit is contained in:
syuilo 2018-09-23 16:05:26 +09:00
parent 8028c85c67
commit e4e668b327
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -20,11 +20,15 @@ export default (
: new mongo.ObjectID(note);
// Remove document
await NoteUnread.remove({
const res = await NoteUnread.remove({
userId: userId,
noteId: noteId
});
if (res.deletedCount == 0) {
return;
}
const count1 = await NoteUnread
.count({
userId: userId,