def get_internal(resource, **lookup):
 datasource = config.DOMAIN[resource]['datasource']
 aggregation = datasource.get('aggregation')
 if aggregation:
  return _perform_aggregation(resource, aggregation['pipeline'], aggregation['options'])
 else:
  return _perform_find(resource, lookup)

def get_internal ( resource , ** lookup ) : datasource = config . DOMAIN [ resource ] [ 'datasource' ] aggregation = datasource . get ( 'aggregation' ) if aggregation : return _perform_aggregation ( resource , aggregation [ 'pipeline' ] , aggregation [ 'options' ] ) else : return _perform_find ( resource , lookup )
retrieves the resource documents that match the current request .