implement endswith and startwith in Query