bookshelf-upsert
A Bookshelf plugin that adds
model.upsert()
Install
$ npm install --save bookshelf-upsert
Plugging In
const upsert = bookshelf
Usage
const model = model
API
model.upsert([attributes], [options])
Bookshelf model instances are provided the upsert
method, which may be given attributes and options that will be passed along to model.save()
. This implementation of upsert first attempts an update then if no rows are updated it follows up with an insert.
License
MIT