Document.prototype.isModified()

Parameters
  • [path] «String» optional
Returns:
  • «Boolean»

Returns true if any of the given paths is modified, else false. If no arguments, returns true if any path in this document is modified.

If path is given, checks if a path or any full path containing path as part of its path chain has been modified.

Example

  1. doc.set('documents.0.title', 'changed');
  2. doc.isModified() // true
  3. doc.isModified('documents') // true
  4. doc.isModified('documents.0.title') // true
  5. doc.isModified('documents otherProp') // true
  6. doc.isDirectModified('documents') // false