I'm using Backbone Collections and Models from an API. My id attribute is the default id attribute for mongo (_id) but in my API, I use a different unique key to get to a single Model. Something like a slug that is always unique.
The problem now is that when I want to save(), it does a PUT
request instead of POST
because it assumes that there is already a Model with this key (slug) because the user is able to enter the slug by himself (with proper validations of course).
Is there a way that I can 'say': "Ok, my idAttribute is _id
but i want you to use slug
when fetching data?