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#ejectAll

DS#ejectAll(resourceName[, params][, options])

Eject all matching items of the specified type from the data store. Ejection only removes items from the data store and does not attempt to destroy items via an adapter.

Returns any ejected items.

Arguments
nametypedescription
resourceNamestringThe name of the resource to use. Unnecessary if using the resource directly.
paramsobjectQuery parameters for selecting which items to eject. Default: {}. See Query Syntax for how to filter, sort, limit and offset.
optionsobjectConfiguration options.
options.notifybooleanWhether to call the beforeEject and afterEject hooks and emit the DS.eject event. Default: true.
Live Demo

👍

Method Variants

You can call DS#ejectAll multiple ways:

  • DS#ejectAll(resourceName[, params][, options])
  • Resource#ejectAll([params][, options]) - Where Resource was created by DS#defineResource

📘

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#ejectAll


DS#ejectAll(resourceName[, params][, options])

Suggested Edits are limited on API Reference Pages

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