I do not think you are defining a comparator correctly. If you define a comparator, the objects will be inserted into the collection in the correct order.
Here is an example that you can simply run through firebug on a site with a loaded database:
var Chapter = Backbone.Model; var chapters = new Backbone.Collection; chapters.comparator = function(chapter) { return chapter.get("page"); }; chapters.add(new Chapter({page: 9, title: "The End"})); chapters.add(new Chapter({page: 5, title: "The Middle"})); chapters.add(new Chapter({page: 1, title: "The Beginning"})); chapters.pluck('title');
Notice how the comparator returns the value stored in the page attribute of each chapter. Sorting trunk collections acts like sortBy, which uses strings or ints and does not follow the traditional -1.0,1 comparison approach.
source share