How to make a filter in new Ember data? Just as a filter compares with a search in new Ember data

Which is equivalent

App.Person.filter(function(e){return e.get('age') == 30}) 

to the new Ember data ?


In the old Ember data, App.Model.filter created a different type of object compared to App.Model.find ( see this question ). I found a difference in types, because if I wanted to record and make changes, I had to use filter . So, find was kind of read-only. (Correct me if I am wrong.)

Is this in the case of new Ember data?

+7
ember-data
source share
1 answer

In the new Ember Data (Beta 1.0.0), you can use the filter function from the DS.Store class . Unlike the previous filter function of the model, you must specify the type of the required model:

 this.get('store').filter('person', function(record){return record.get('age') == 30}); 
+11
source share

All Articles