Added pattern matching to the db pull operation