I'm studying MongoDB(mongoose)
.
So I've a question on Model.findByIdAndRemove()
and Model.findByIdAndDelete()
of Mongoose
- what's the difference between both of them.
mongoose-docs
What's the proper use of each?
findByIdAndDelete & findByIdAndRemove are same other than findOneAndRemove uses findAndModify with remove functionality with time to execution of particular amount of operations.
by doing comparison findByIdAndDelete is always better than findByIdAndRemove.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With