js-data

Respect Your Data

Give your data the treatment it deserves with a framework-agnostic, datastore-agnostic JavaScript ORM built for ease of use and peace of mind. Works in Node.js and in the Browser.

Get Started

DS#changes

DS#changes(resourceName, id[, options])

Synchronously return the changes object of the item of the type specified by resourceName that has the primary key specified by id. This object represents the diff between the item in its current state and the state of the item the last time it was saved via an adapter.

👍

You can call DS#changes multiple ways

  • DS#changes(resourceName, id[, options])
  • Resource#changes(id[, options]) - Where Resource was created by DS#defineResource
  • Instance#DSChanges([options]) - Where Instance is an instance of a Resource

Argument

Type

Description

resourceName

string

The name of the resource to use. Unnecessary if calling changes directly on a Resource.

id

string or number

The primary key of the item whose changes are to be retrieved.

options

object

Optional configuration. Default: { }

options.ignoredChanges

array

Array of strings or regular expressions of fields, the changes of which are to be ignored. Defaults: [ ] .

Demo

📘

Need help?

Want more examples or have a question? Ask on the Slack channel or post on the mailing list then we'll get your question answered and probably update this wiki.

Updated less than a minute ago

DS#changes


DS#changes(resourceName, id[, options])

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.