dimanche 25 octobre 2015

Ember data, how to get max id for store

need your help. Is there a way to query the ember data store to find the max id for a given model? I know I could find all, walk through the objects, store ids when they are greater than the previous, etc, etc.

I'm new to Ember, I'm used to being able to call aggregate methods on database, you know, max(), min(), sum() all that stuff. There HAS to be a way to do this in ember, right? I have searched and searched, I'm honestly a little mystified that I can't find anything for what has to be a very common use-case.

I'm currently using fixtures, want to add a new line to an order. When I create the new record I need to find the max id of all other records so I can increment it for the new record.




Aucun commentaire:

Enregistrer un commentaire