filter arrays using mongodb queries