Model.createOne() returns the created model instance. Model.update() returns the updated instance if the configuration parameter return is set to `true.
How come relationships do not have these options? The current alternative is to create/modify the relationship, then perform a findRelationships() to get the newly created data. A return parameter (or implicit return) would help to streamline the actions into a single function call. Relationship methods are also missing, for example, a throwIfNotFound parameter, meaning you have to check and throw the error manually.
Model.createOne()
returns the created model instance.Model.update()
returns the updated instance if the configuration parameterreturn
is set to `true.How come relationships do not have these options? The current alternative is to create/modify the relationship, then perform a
findRelationships()
to get the newly created data. Areturn
parameter (or implicit return) would help to streamline the actions into a single function call. Relationship methods are also missing, for example, athrowIfNotFound
parameter, meaning you have to check and throw the error manually.