Page Contents

Home > @loopback/repository > Model > toObject

Model.toObject() method

Convert to a plain object as DTO

If ignoreUnknownProperty is set to false, convert all properties in the model instance, otherwise only convert the ones defined in the model definitions.

See function asObject for each property’s conversion rules.

Signature:

toObject(options?: Options): Object;

Parameters

Parameter Type Description
options Options  

Returns:

Object