insert same value denied


good day, I have a query where I should change the value of a boolean for its denied value, for it would take care of the positional $ operator but what I do not find in the documentation is how to deny it, I leave the query that I am using:

let listElements = await Card.findOneAndUpdate({_id : idCard, owner : idUser, "listElements._id" : idListElement}, {$set : {"listElements.$.enabled" : !"$listElements.$.enabled"} }, {new : true})

Where the value I want to deny is listElement. $. enable and common sense would tell me that it is with the simple negation "!" but it does not work.

thanks in advance.

asked by Hitzu Torres 20.11.2018 в 16:40

0 answers