1.2.1 • Published 8 years ago

bookshelf-crud v1.2.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Bookshelf-crud

Simple CRUD for Bookshelf models

How to use

var bookshelf = require("bookshelf");
// ...
bookshelf.plugin(require("bookshelf-crud"));

Examples

	User.findAll({password: "12345678"})
	User.findAll({password: "12345678", "email": "ccrisrober@gmail.com"})
	User.findOne({email: "ccrisrober@gmail.com"})
	User.findOne({id: 2})
	User.findById(2)
	User.create({
		email: "jojo@jojo.com",
		password: "666666666",
		name: "Follow the leader"
	})
	User.updateOrCreate({
		id: 115
	}, {
		email: "whatthefuck@gmail.com",
		password: "666666666",
		name: "Follow me"
	})
	User.destroy({id: 4})
	User.update({
		id: 500
	}, {
		username: "Joselito1"
	})
	.then(function(user) {
		res.json(user);
	})
	.catch(function(err) {
		res.json(err);
	});
1.2.1

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago