
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
backbone-pouch-collection
Advanced tools
Hooks up PouchDB to a Backbone collection. Allows you to easily retrieve your data from CouchDB/PouchDB views.
npm install backbone-pouch-collection
Define the query options in your collection definition.
opts
can be an object or a function which returns an object.
You also need to provide a PouchDB instance to your collection.
opts.view
can also be _all_docs
to query...well... _all_docs
.
The defaults are _all_docs
and include_docs: true
.
var PouchBase = require('backbone-pouch-collection')
var Collection = PouchBase.extend({
db: new Pouchdb('foo'),
opts: {
view: 'your/viewname',
params: {
// all the (c/p)ouchdb view params you want
}
}
myMethod: function () {}
})
You can also pass options to collection.fetch()
to override the
default.
// fetch() returns a promise
collection.fetch({
couch: {
// all the (c/p)ouchdb view params you want
}
})
To run the unit tests:
npm test
Copyright (c) 2014 Clemens Stolle Licensed under the MIT license.
FAQs
Backbone Collections with PouchDB as the data source
The npm package backbone-pouch-collection receives a total of 0 weekly downloads. As such, backbone-pouch-collection popularity was classified as not popular.
We found that backbone-pouch-collection 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's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
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.