Add filter and average function to DB collection