Comparing version 0.4.3 to 0.4.4
26
nano.js
@@ -206,2 +206,22 @@ /* Minimal Couch In Node | ||
/* | ||
* CouchDB Database _changes feed | ||
* | ||
* e.g. nano.db.changes(db_name, {since: 2}, function (e,h,r) { | ||
* console.log(r); | ||
* }); | ||
* | ||
* @param {db_name:string} The name of the database | ||
* @param {params:object:optional} Additions to the querystring | ||
* | ||
* @see relax | ||
*/ | ||
function changes_db(db_name, params, callback) { | ||
if(typeof params === "function") { | ||
callback = params; | ||
params = {}; | ||
} | ||
relax({db: db_name, doc: "_changes", params: params, method: "GET"},callback); | ||
} | ||
/* | ||
* Replicates a CouchDB Database | ||
@@ -420,6 +440,3 @@ * | ||
, compact: function(cb) { compact_db(db_name,cb); } | ||
// hook.io? socket.io? | ||
//, changes: { add: add_listener | ||
// , remove: remove_listener} | ||
// Probably just support it and let others do this | ||
, changes: function(params,cb) { changes_db(db_name,params,cb); } | ||
, insert: insert_doc | ||
@@ -449,2 +466,3 @@ , update: update_doc | ||
, replicate: replicate_db | ||
, changes: changes_db | ||
} | ||
@@ -451,0 +469,0 @@ , use: document_module |
{ "name": "nano" | ||
, "description": "NanoCouch is a minimalistic driver for CouchDB built on mikeals/request" | ||
, "homepage": "http://github.com/dscape/nano" | ||
, "version": "0.4.3" | ||
, "version": "0.4.4" | ||
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)" | ||
@@ -6,0 +6,0 @@ , "keywords": ["CouchDB", "data", "request", "json", "nosql", "micro", "nano"] |
@@ -74,2 +74,3 @@ # nano | ||
`nano.db.replicate(source,target,continuous*,callback*)` | ||
`nano.db.changes(db_name,params*,callback*)` | ||
`nano.use(db_name)` | ||
@@ -97,3 +98,2 @@ `nano.request(opts,callback*)` | ||
`doc.attachment.destroy(doc_name,att_name,rev,callback*)` | ||
`doc.view.compact(design_name,callback*)` | ||
@@ -106,3 +106,4 @@ ### aliases | ||
`nano.db.replicate: [doc.replicate(target,continuous*,callback*)]` | ||
`nano.db.compact: [doc.compact(callback*)]` | ||
`nano.db.compact: [doc.compact(callback*), doc.view.compact(design_name,callback*)]` | ||
`nano.db.changes: [doc.changes(params*,callback*)]` | ||
@@ -109,0 +110,0 @@ ## advanced |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23606
511
174