Javascript – Can i get the index of a specific element in array while updating in mongodb?
Given this update statement const result = await Post.updateOne({_id: postId},{ $pull: {reacts: {publisher: req.query.publisher}}, $inc: {postPoints: - reactsEnum[ReactType]} }); I want to get the react Type of the react pulled from the array in the $pull operation. is it possible…