Back
updateByKey()
Finds the object with the supplied key
and saves it (if validation permits it) with the supplied properties
and / or named arguments.
Property names and values can be passed in either using named arguments or as a struct to the properties
argument.
Returns true
if the object was found and updated successfully, false
otherwise.
// Updates the object with `33` as the primary key value with values passed in through the URL/form
result = model("post").updateByKey(33, params.post);
// Updates the object with `33` as the primary key using named arguments
result = model("post").updateByKey(key=33, title="New version of Wheels just released", published=1);
Copied!