Page Contents

Home > @loopback/repository > BelongsToRepository > get

BelongsToRepository.get() method

Gets the target model instance

Signature:

get(options?: Options & {
        polymorphicType?: string | string[];
    }): Promise<Target>;

Parameters

Parameter Type Description
options Options & { polymorphicType?: string | string[]; } (Optional) options.polymorphicType - a string or a string array of polymorphic type names to specify which repositories should are expected to be searched It is highly recommended to contain this param especially for datasources using deplicated ids across tables

Returns:

Promise<Target>

A promise resolved with the target object or rejected with an EntityNotFoundError when target model instance was not found.