To delete an object you can call db.remove with the object.
Similiar to editing a document, both the _id
and _rev
properties are required. You may notice that we are passing around the full object that we previously read from the database. You can of course manually construct the object, like: {_id: todo._id, _rev: todo._rev}
, but passing around the existing object is usually more convenient and less error prone.