How do I update a boolean field to its opposite in Mongoose?

Viewed 749

So I have this function:

async function update_subscription_status(id) {
    await User.updateOne({chat_id: id}, {
        mailing: // need to change this boolean field to its opposite       
    })
}

Is there any way to do it without checking its state before updating?

1 Answers
Related