js-data unsaved not returning objects with changes

24 views Asked by At

I have a user from my API in my js-data store and I changed it's name. I didn't save the record yet.

Why doesn't ds.unsaved('user') return an empty array?

1

There are 1 answers

0
Raymundus On BEST ANSWER

The unsaved() function returns only records that have no id. No matter if they have changes or not.

According to the docs

Return all "unsaved" (not uniquely identifiable) records in this colleciton.