How to locate a match in database?

Dear all, I am a newbie on Asterisk.

Currently I wish to delete database entries which has a match with station 5001.

The following is my code:
exten => 500,1,ExecIf($[${DB(family/unknown)=1001}]|DB_DELETE|family/unknown)

My AstDb as below, assuming i dont know how many entries are there.
CLI> database show hotdesknum
/hotdesknum/1001 : 5001
/hotdesknum/1002 : 5001
/hotdesknum/1004 : 5001
/hotdesknum/3964 : 1002

What should i enter as the key of the database “hotdesknum” in order to delete the entry which has a match = 5001?
Assuming i dont know how many extensions(1001,1002,1004,…) in the database.

Thanks in advance.