Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the difference between find, findAll and findQuery in ember-data

Tags:

ember-data

What is the difference between find, findAll and findQuery in ember-data?

like image 623
Aaron Renoir Avatar asked May 03 '13 05:05

Aaron Renoir


1 Answers

find is a convenience wrapper for findAll, findQuery and findById.

  • findAll will return all the records of a specific type (this will trigger a request to the server) all is basically the same but uses the cache, so if you have records in your store, no request will be made
  • findQuery is to return a subset from your server
  • findById returns a single object

https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/store.js#L431

like image 148
Cyril Fluck Avatar answered Sep 25 '22 14:09

Cyril Fluck