How To Clear All Records in the Local Ember Data Store

Last reviewed in June 2019 with Ember Octane

A quick search for this question will return many different workarounds, like iterating over the defined models and unloading by type or going nuclear and destroying the whole store.

It is possible to unload all records simply by calling unloadAll with no arguments:

store.unloadAll();

(Remember: store is automatically injected in all routes and controllers.)

Enjoyed this article? Join Snacks!

Snacks is the best of Ember Octane in a highly digestible monthly newsletter. (No spam. EVER.)