I use Mongo DB.
I want to update Video model's show field.
If it is false then true, if else it is true then to false.
So i use this logic false ? true : false.
But it seems not working.
In this case how can I make my purpose?
export const showVideo = async (req, res) => {
const { id } = req.params;
await Video.findByIdAndUpdate(id, {
show: false ? true : false,
});
return res.redirect("/video");
};