You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Register individual models (not required if you passed in a root model directory as above):
bookshelf.manager.register(model,modelName);
Note: Also compatible with models registered with the Bookshelf Registry plugin.
Use the methods on bookshelf.manager to create, fetch, and save models or collections with support for deeply-nested attributes. E.g.:
returnbookshelf.manager.create('car',{features: [{name: 'ABS',cost: '1250'},{name: 'GPS',cost: '500'}],quantity: 1}).then(function(car){// created car should now have the associated features});
API
In progress...
Changelog
v0.3.0 - Add setHasOne functionality (#12)
v0.2.1 - Several breaking changes occurred with this version due to updating devDependencies and peerDependencies:
Knex and Bookshelf updated their bluebird and lodash dependencies
Knex changed how undefined values are inserted
v0.1.0 - Reimplement as a plugin for Bookshelf/Knex 0.8.x
v0.0.10 - Enforce belongsToMany IDs
v0.0.9 - Destroy removed hasMany models
v0.0.8 - Fetch empty collections
v0.0.7 - Attempt to use existing, eager-loaded models rather than re-fetch