Removing Elements from a Database
The simplest way to remove elements from a database is using the DB→del interface, which takes four of the same five arguments that the DB→get and DB→put interfaces take (the difference is that there is no need to specify a data item because the delete operation is only interested in the key that you want to remove), as follows:
db: The database handle returned by db_create.
txnid: A transaction ID. In our simple case, we don’t expect to recover the database after an application or system crash, so we aren’t using transactions and will leave this argument unspecified.
key: The key item for the key/data pair that we want to delete from the database.
flags: Optional flags that modify the underlying behavior of ...