code: def service_location(doc):
      
      for service_id, service in doc.get('services', {}).items():
          service['id'] = service_id
          service['organisation_id'] = doc['_id']
  
          location = service.get('location', None)
          if location:
              yield location, service
docs: View for getting service by location