As stated in the Model.save Documentation :
save model.save ([attributes], [options])
[...] The attribute hash (as in the set) must contain the attributes that you want to change - keys that are not mentioned will not be changed - but, the presentation of the resource is completed, it will be sent to the server.
However, you can override the save method and provide the data attribute through the parameters that will be sent to the server, rather than a complete representation of the model. For example, this will save only the attributes passed to the method:
var M = Backbone.Model.extend({ save: function (attrs, options) { options || (options = {}); options.contentType = 'application/json'; options.data = JSON.stringify(attrs); Backbone.Model.prototype.save.call(this, attrs, options); } });
And the script is http://jsfiddle.net/dLFgD/
As @mikebridge commented, this behavior can now be obtained by passing the attrs option. Therefore either use
book.save(null, { attrs: {author: "Teddy"} });
or save override
var M = Backbone.Model.extend({ url: '/echo/json/', save: function(attrs, options) { options || (options = {}); options.attrs = attrs; Backbone.Model.prototype.save.call(this, attrs, options); } });
http://jsfiddle.net/nikoshr/dLFgD/7/
You can also send a PATCH request if you use a version of Backbone that supports it (> = 0.9.9), and your server understands this verb, as explained in @pkyeck to answer
nikoshr Jul 17 2018-12-12T00: 00Z
source share