Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Mail } = require('../config/MailModel.js');
- const { ObjectId } = require('mongoose').Types;
- function markAsRead (id) {
- Mail.findByIdAndUpdate(
- id,
- { unread: false },
- { new: true },
- function(err, doc) {
- if (err) {
- console.log(err);
- }
- else {
- console.log('attempted to set unread to false on id: ', id, '\nwith the response of: ', doc);
- }
- }
- );
- }
- module.exports = markAsRead;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement