Query db function by filter

Signed-off-by: Lee <jessy1092@gmail.com>