Return to v2.5.0 docs


Model Object Change Functions boolean model

Returns true if the specified property (or any if none was passed in) has been changed but not yet saved to the database. Will also return true if the object is new and no record for it exists in the database.

Name Type Required Default Description
property string No Name of property to check for change.
// Get a member object and change the `email` property on it
member = model("member").findByKey(params.memberId); = params.newEmail;

// Check if the `email` property has changed
    // Do something...

// The above can also be done using a dynamic function like this
    // Do something...

Related Functions

Change Functions