In express and mongodb I want delete document by id findOneAndDelete() Can not delete by _id, can only delete by field ! why ?
db.collection(\'quotes\').findOneA
In short:
deleteOne()
(to delete a single document) and deleteMany()
(to delete multiple documents)findOneAndDelete()
should be able to delete on _id
.