db count key
The db count command returns a count of the number of duplicate data items for the key given. If the key does not exist, a value of 0 is returned. If there are no duplicates, or if the database does not support duplicates, but a key/data pair exists, a value of 1 is returned. If an error occurs, a Berkeley DB error message is returned or a Tcl error is thrown.