Page Contents

Home > @loopback/repository > HasOneRepository > delete

HasOneRepository.delete() method

Delete the related target model instance

Signature:

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

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<Count>

A promise which resolves the deleted target model instances