D
D
Denis11112018-10-03 22:02:23
MongoDB
Denis1111, 2018-10-03 22:02:23

(node:1944) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead?

I have a file that deletes the session when the logout button is clicked.

exports.post = function(req, res) {
  req.session.destroy();
  res.redirect('/');
 };

But when I click on it, I get this warning in my console:
(node:1944) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
I understand that remove needs to be changed to deleteOne/deleteMany. In my code, I didn't use remove at all! Where does the warning come from and why does it appear at all if there is no problem!?!?!?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2018-10-03
@BuriK666

Apparently called insidereq.session.destroy();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question