I think you are probably looking for some kind of shortcut, but don't think that there is one:
var Promise = require('bluebird'); var Book = bookshelf.Model.extend({ tableName: 'books' }); var Page = bookshelf.Model.extend({ tableName: 'pages' }); var Pages = bookshelf.Collection.extend({ model: Page }); Book.forge({name: 'Hello', author: 'World'}).save() .then(function(book) { var pages = Pages.forge([ {pagetitle: 'intro', book: book.id}, {pagetitle: 'chatessr1', book: book.id} ]); return pages.invokeThen('save', null); }).then(function(){
source share