Class: HasMany

HasMany(definition, modelInstance) → {HasMany}

HasMany

Constructor

new HasMany(definition, modelInstance) → {HasMany}

HasMany subclass
Parameters:
Name Type Description
definition RelationDefinition | Object
modelInstance Object
Source:
Returns:
Type
HasMany

Members

build

Build a target model instance
Source:

Methods

destroyById(fkId, optionsopt, cb)

Delete a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key
options Object <optional>
Options
cb function The callback function
Source:

exists(fkId, optionsopt, cb)

Find a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key
options Object <optional>
Options
cb function The callback function
Source:

findById(fkId, optionsopt, cb)

Find a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key
options Object <optional>
Options
cb function The callback function
Source:

updateById(fkId, Changes, optionsopt, cb)

Update a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key
Changes Object to the data
options Object <optional>
Options
cb function The callback function
Source: