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.

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.