
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
LazyBoy makes it easier to build applications with Couchdb. It removes the repeatable cruft and makes working with Couchdb as fun as it should be.
Download
npm install lazyboy
Connect to database
var Model = require('lazyboy') Model.create_connection("my_database");
Define a model
Model.define('User', { name: String surname: {type: String, default: "Rambo"} })
Read the docs: http://garrensmith.com/LazyBoy
Below is a quick cheatsheet but the docs can be found at http://garrensmith.com/LazyBoy
var Model = require('LazyBoy');
Model.define('User', {
name: String
surname: {type: String, default: "Rambo"}
})
var user = Model.create('User', {name: "John", surname: "Rambo"});
user.save(function (err, saved_user) {
// .. do some other stuff here
})
var user_id = "123456";
var User = Model('User');
User.find(user_id, function (err, user) {
// .. do something with the user
})
var User = Model('User');
User.all(function (err, users) {
// .. do something with the user
})
var User = Model('User');
User.where("name","Ben", function (err, users) {
// .. do something with the users
})
var User = Model('User');
User.findFirst('name', 'Ben', function (err, user){
// .. do something with the user
})
var Band = Model.define("Band",{rank: Number, name: String});
Band.addView('ByRankAndName',{
map: function (doc) {
if (doc.model_type === 'Band') {
emit([doc.rank, doc.name],1);
}
}
});
Band.view('ByRankAndName')
.startkey([2, "Incubus"])
.endkey([3, {}])
.limit(10)
.skip(3, function (err, bands) {
// will only execute the chain when a function has a callback passed to it
});
Logging has been disabled for now.
#What needs doing?
#Changelog
#Contributors
FAQs
A object document mapper for couchdb
We found that LazyBoy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.