Improve performance

This commit is contained in:
syuilo 2018-09-23 16:05:26 +09:00
parent 113e90f170
commit b2215c8bdc

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,