I have the following code
let doc = await IssueModel.findOne({ content_id }) IssueModel.findOneAndUpdate({ content_id }, { $set: { assigned_user, status: doc.status==='done' ? 'done' : 'ongoing' } }) I'm looking for a shorter way to omit the first line, and access status current value before updating it inside the findOneAndUpdate , something similar to this maybe. I want to update status only if it's different from 'done'.