{"_id":"felix-couchdb","_rev":"27-3902f8f36a43bac811e79ad83ef9fd41","name":"felix-couchdb","description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.0":{"name":"felix-couchdb","version":"1.0.0","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"3f4c981099381b13ff120ae451e5b36326478afe","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.0.tgz","integrity":"sha512-45EQRyzHgZl+Tuvn8orNENSDG2ApoiuD03runtZKRR+q71Xskg9jF1CmyC4YRxX8zm6kLYeEZcOhSWzX3sTnhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOR5Kc7w80m4QghWN8+6oKtnZjrB5sLTeDbAZ0kpBw+AIgdnJP6xkUdGphvtDxIKsN7O8HPMdaCePJLe+2Agu56os="}]},"scripts":{},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"}]},"1.0.1":{"name":"felix-couchdb","version":"1.0.1","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"7e636e077a63059c69ef251fa96a4b4f762ee820","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.1.tgz","integrity":"sha512-GNlRAjCXfdAC7cE6zssMwfs9ru/4zEbT1pmlKpqYAFPRjA/1GYSZNJ3SJoWlV8LqCWteTKbBcgCkZdC2EwoMvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7JkzT4Eo4RQXgFrtu/1/8vg7TqcHjtQscQjffpmCovAiEAtWJTz3w1L3Z3lQD+zm2kw5UvEZ9OhTEYhJKR628tUsc="}]},"scripts":{},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"}]},"1.0.2":{"name":"felix-couchdb","version":"1.0.2","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.2","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"beab1f07c7797da7658034046ce02cce3607364a","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.2.tgz","integrity":"sha512-YkwThk3o6K3hZshdfXobSrDa816JuX1TI5HoYm5LSYR+2aeWOAric4QWbZWlmwNe9WQrkK4chALxOga0kBejdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjNfuSKNNWHIpqkrr74BTk050VMEarJJOrGypvieGnKAiBxL8lCB+Cb1Fnk4H6+sdWQ5vpOWQl7mEQP6W6j0p9vdg=="}]},"scripts":{},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"}]},"1.0.3":{"name":"felix-couchdb","version":"1.0.3","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_npmUser":{"name":"felixge","email":"felix@debuggable.com"},"_id":"felix-couchdb@1.0.3","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.13-pre","_defaultsLoaded":true,"dist":{"shasum":"cd24ce4c3ca16f605e9dc9ca0adad11e36758ee9","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.3.tgz","integrity":"sha512-2knaHKeY+PagIKriPGp3V7ALDQgBnrLQ46LvVUPbgqAQJuyyeoGNH5xrlK22zOjf3lkAllryFwJ+8ondA5QtJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/kzv28BMVpTpjz13E7z/jUyKdVt1l8hhWrDBz7UAzQAiB6copq8qpAS50TYo+ysGr5CLUXogjYKAkXqVhEmNt3mw=="}]},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"}]},"1.0.4":{"name":"felix-couchdb","version":"1.0.4","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.4","dist":{"shasum":"7385158b53018f97ffcb628ac14d326ecb8c868d","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.4.tgz","integrity":"sha512-l2iWOAMllmVyf01+1g0rpfUf6r828ur0ZewpC/dpAAyDs6d+uCSmJHiA7k1v2KGhGortBziMhQMycFdicvPhDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDESXXwacnNCndJPcoiQL/FrLooLoqz9i2ijFw6ypFWkAiBetEEjeFqsnuGWEv30/nALRTndk4vTUmiSM9LW5Dl4SA=="}]},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"},{"name":"mcoolin","email":"mcoolin@techie.com"}]},"1.0.5":{"name":"felix-couchdb","version":"1.0.5","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.5","dist":{"shasum":"681bb51eee40b6323b5ce54aae35f037c25eb2f3","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.5.tgz","integrity":"sha512-VYRH8qq4fUzy8RiKh39BQ2hpxIV+aaTuhFzxO3hq3OfCPeWsBN3VcmHJ1wiTXrRMHxDBf/1dfZ0VaBi7OrECpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkY9adYULu8rOtTEcCvq0DzjHNXw8+TWPN+hVnBW9zIgIgO12EH8Yzck/lmzKeKL3Jqi8Nd6u0SlB5gLt/u4eakfM="}]},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"},{"name":"mcoolin","email":"mcoolin@techie.com"}]},"1.0.6":{"name":"felix-couchdb","version":"1.0.6","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.6","dist":{"shasum":"c757c1b98074591507440c5c2838ef7d888d8520","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.6.tgz","integrity":"sha512-o9gfmSuayVGBud2nQB+gD4lVuRoI0Y4oaYtFPKY9D5CRfn+jZCy8rXyydwJyMMZgJ2TeqecKbT7adQc4Wq+C1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/swZyKaDZC8O0ZfNnYc/YMUK8XRTfM9ow0P3LrVAb6AiA2KmK6ITicUQI7D1YkRJnP3AQHxcigYKm7bGpWJdo26Q=="}]},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"},{"name":"mcoolin","email":"mcoolin@techie.com"}]},"1.0.7":{"name":"felix-couchdb","version":"1.0.7","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"_id":"felix-couchdb@1.0.7","dist":{"shasum":"454afa413d01aaebc41e70e0d251f31027c27240","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.7.tgz","integrity":"sha512-c82Kt7ppKFzS4QDyUINtg/a52zgLSHy0vja4p02uy/SKO6yuzvH3quJc1XcvBJX9HfxkONTtdUNTeSm3A/PRnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBksmN2wQyoEO1+sYOfIgPGNu3IMKUQ3FblW0v3LYukqAiEA/PWUAiCl9akUhHlf8/zHdxMh80ict9ZI0EeZuy4MaX8="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"felixge","email":"felix@debuggable.com"},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"},{"name":"mcoolin","email":"mcoolin@techie.com"}]},"1.0.8":{"name":"felix-couchdb","version":"1.0.8","author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"description":"A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me","keywords":["couch","couchdb"],"engines":["node"],"directories":{"lib":"lib"},"main":"lib/couchdb","dependencies":{},"devDependencies":{},"gitHead":"00e0deb5c3f47bec6b588c8cc17a7f4d0e69ba72","_id":"felix-couchdb@1.0.8","scripts":{},"_shasum":"36a8b6696c6d0424cc3fec8fc33aa6d8e8d554e0","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"felixge","email":"felix@debuggable.com"},"maintainers":[{"name":"norlin","email":"myxaxaxa@gmail.com"},{"name":"felixge","email":"felix@debuggable.com"},{"name":"mcoolin","email":"mcoolin@techie.com"}],"dist":{"shasum":"36a8b6696c6d0424cc3fec8fc33aa6d8e8d554e0","tarball":"https://registry.npmjs.org/felix-couchdb/-/felix-couchdb-1.0.8.tgz","integrity":"sha512-O6Vd+rh6Xn1/kAVUvkDrRPNLJAzfzN/TxdV5HxPFtb2vXK4+cMy6z785B4i0u91qGw+NvVkzu7HSfzf8VWL9yA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJf4h9i/yfWIE5qAxtoHEGRpuiwV1Ju76pGBnUMTqgjAiEAmIesRhq0F5IElY8OjyghKHnuPzaSefACuGeXAXPvW9k="}]}}},"maintainers":[{"email":"felix@debuggable.com","name":"felixge"},{"email":"mcoolin@techie.com","name":"mcoolin"},{"email":"myxaxaxa@gmail.com","name":"norlin"}],"time":{"modified":"2022-06-18T00:08:28.933Z","created":"2011-09-26T13:05:26.440Z","1.0.0":"2011-09-26T13:05:27.158Z","1.0.1":"2011-10-04T16:47:30.554Z","1.0.2":"2011-10-04T17:02:22.722Z","1.0.3":"2011-11-20T13:56:45.389Z","1.0.4":"2012-09-05T13:04:03.863Z","1.0.5":"2012-09-05T13:26:38.863Z","1.0.6":"2012-09-23T09:20:30.427Z","1.0.7":"2013-05-19T08:13:12.016Z","1.0.8":"2015-10-01T08:14:33.593Z"},"author":{"name":"Alexey Makarov","email":"alexey@norlin.ru"},"users":{"kachar":true},"readme":"# Now maintained and active!!! \n\n# I'd like to thank Felix for creating this and hope you find it useful when working with node and couchDB.\n\n\n# Node.js CouchDB module\n\nA thin node.js idiom based module for [CouchDB's REST API](http://wiki.apache.org/couchdb/HTTP_REST_API) that tries to stay close to the metal.\n\n## Tutorial\n\nInstallation is simple from [NPM](http://npmjs.org/):\n\n    $ npm install felix-couchdb\n\nTo use the library, create a new file called `my-couch-adventure.js`:\n\n    var\n      util = require('util'),\n      couchdb = require('felix-couchdb'),\n      client = couchdb.createClient(5984, 'localhost'),\n      db = client.db('my-db');\n\n    db\n      .create(function(er){\n        if (er) throw new Error(JSON.stringify(er));\n        util.puts('Created new db.');\n      });\n\n    db\n      .saveDoc('my-doc', {awesome: 'couch fun'}, function(er, ok) {\n        if (er) throw new Error(JSON.stringify(er));\n        util.puts('Saved my first doc to the couch!');\n      });\n\n    db\n      .getDoc('my-doc', function(er, doc) {\n        if (er) throw new Error(JSON.stringify(er));\n        util.puts('Fetched my new doc from couch:');\n        util.p(doc);\n      });\n\nIf you are wondering if there is a race-condition in the above example, the answer is no. Each `couchdb.Client` uses an internal queue for its requests, just like `http.Client`. This guarantees ordering. If you want to perform multiple requests at once, use multiple `couchdb.Client` instances.\n\n## API Documentation\n\n### Callbacks\n\nAll asynchronous functions are performed with callbacks.  Callback functions are always the last argument, and always receive one or two arguments.  The first argument is an error object or `null` if no error occurs.  The second is the data returned by the function in question, if appropriate.\n\nThe callback argument is optional.  If not supplied, then errors and return values will be silently ignored.\n\nFor example:\n\n    client.request('/_uuids', {count: 2}, function (er, data) {\n      if (er) {\n        // an error occurred.  Attempt to handle it or rethrow, or whatever.\n      } else {\n        // data is the result of the request.\n      }\n    })\n\n### couchdb.toJSON(data)\n\nIdentical to `JSON.stringify()`, except that function values will be converted to strings like this:\n\n    couchdb.toJSON({\n      foo: 'bar',\n      fn: function(a, b) {\n        p(a, b);\n      }\n    })\n    // => {\"foo\":\"bar\",\"fn\":\"function (a, b) {\\n    p(a, b);\\n  }\"}\n\nnode-couchdb uses this function everywhere for JSON serialization, this makes it convenient to embed functions.\n\n### couchdb.toQuery(query)\n\nIdentical to `querystring.stringify()`, except that boolean values will be converted to `\"true\"` / `\"false\"` strings like this:\n\n    couchdb.toQuery({\n      include_docs: true\n    })\n    // => include_docs=true\n\nnode-couchdb uses this function everywhere for query serialization, this helps since couchdb expects boolean values in this format.\n\n### couchdb.toAttachment(file, cb)\n\nTakes the path of a `file` and callback receives a JS object suitable for inline document attachment:\n\n    couchdb\n      .toAttachment(__filename, function(er, r) {\n        if (er) throw new Error(JSON.stringify(er));\n        // r => {\"content_type\":\"text/javascript\",\"data\":\"dmFyCiAgs...=\"}\n      });\n\nCheck `lib/dep/mime.js` for a list of recognized file types.\n\n### couchdb.createClient([port, host, user, pass, maxListeners, secure])\n\nCreates a new `couchdb.Client` for a given `port` (default: `5984`) and `host` (default: `'localhost'`). This client will queue all requests that are send through it, so ordering of requests is always guaranteed. Use multiple clients for parallel operations.\n\nIf the optional `user` and `pass` arguments are supplied, all requests will be made with HTTP Basic Authorization\n\nIf the optional `maxListeners` is supplied - module uses emitter.setMaxListeners method. It may be usefull if you use many couchdb requests and don't want to see warnings.\nDefault Node.js value for this == 11 listeners; if `maxListeners` == 0 then warnings are off.\n\nIf the optional `secure` is supplied as true, then the https transport is used. Note that https is usually serviced on port 443. This is useful when using cloud-based CouchDB services such as Cloudant where their API is hosted on a https platform e.g.\n\n      client = couchdb.createClient(443, 'username.cloudant.com','username','password',0,true),\n      \n### client.host\n\nThe host this client is connecting to. READ-ONLY property\n\n### client.port\n\nThe port this client is connecting to. READ-ONLY property\n\n### client.request(path, [query], cb)\n\nSends a GET request with a given `path` and `query`. Callback receives a result object. Example:\n\n    client.request('/_uuids', {count: 2})\n\n### client.request(method, [path, query])\n\nSends a request with a given `method`, `path` and `query`. Callback receives a result object. Example:\n\n    client.request('get', '/_uuids', {count: 2})\n\n### client.request(options, cb)\n\nSends a request using the given `options` and callback receives a result object. Available options are:\n\n* `method`: The HTTP method (default: `'GET'`)\n* `path`: The request path (default: `'/'`)\n* `headers`: Additional http headers to send (default: `{}`)\n* `data`: A JS object or string to send as the request body (default: `''`)\n* `query`: The query options to use (default: {}).\n* `requestEncoding`: The encoding to use for sending the request (default: `'utf8'`)\n* `responseEncoding`: The encoding to use for sending the request. If set to `'binary'`, the response is emitted as a string instead of an object and the `full` option is ignored. (default: `'utf8'`)\n* `full`: By default the callback receives the parsed JSON as a JS object. If `full` is set to true, a `{headers: ..., json: ...}` object is yielded instead. (default: `false`)\n\nExample:\n\n    client.request({\n      path: '/_uuids',\n      query: {count: 5},\n      full: true\n    }, callback);\n\n### client.allDbs()\n\nWrapper for [GET /\\_all\\_dbs](http://wiki.apache.org/couchdb/HTTP_database_API#List_Databases).\n\n### client.config()\n\nWrapper for [GET /\\_config](http://wiki.apache.org/couchdb/API_Cheatsheet).\n\n### client.uuids([count])\n\nWrapper for [GET /\\_uuids](http://wiki.apache.org/couchdb/API_Cheatsheet). `count` is the number of uuid's you would like CouchDB to generate for you.\n\n### client.replicate(source, target, [options])\n\nWrapper for [POST /\\_replicate](http://wiki.apache.org/couchdb/Replication). `source` and `target` are references to the databases you want to synchronize, `options` can include additional keys such as `{create_target:true}`.\n\n### client.stats([group, key])\n\nWrapper for [GET /\\_stats](http://wiki.apache.org/couchdb/Runtime_Statistics). `group` and `key` can be used to limit the stats to fetch.\n\n### client.activeTasks()\n\nWrapper for [GET /\\_active\\_tasks](http://wiki.apache.org/couchdb/API_Cheatsheet).\n\n### client.db(name)\n\nCreates a new `couchdb.Db` instance for a database with the given `name`.\n\n### db.name\n\nThe name of the db this instance is tied to. READ-ONLY property\n\n### db.client\n\nA reference to the `couchdb.Client` this instance is tied to. READ-ONLY property\n\n### db.request(options)\n\nSame as `client.request`, but the `path` option gets automatically prefixed by `'/db-name'`.\n\n### db.exists(cb)\n\nCallback called with a boolean indicating whether this db exists or not.\n\n### db.info(cb)\n\nWrapper for [GET /db-name](http://wiki.apache.org/couchdb/HTTP_database_API#Database_Information).\n\n### db.create(cb)\n\nWrapper for [PUT /db-name](http://wiki.apache.org/couchdb/HTTP_database_API#PUT_.28Create_New_Database.29).\n\n### db.remove()\n\nWrapper for [DELETE /db-name](http://wiki.apache.org/couchdb/HTTP_database_API#DELETE).\n\n### db.getDoc(id, [rev], [attachments])\n\nWrapper for [GET /db-name/doc-id\\[?rev=\\]\\[&attachments=\\]](http://wiki.apache.org/couchdb/HTTP_Document_API#GET). Fetches a document with a given `id` and optional `rev` and/or `attachments` from the database.\n\n### db.saveDoc(id, doc)\n\nWrapper for [PUT /db-name/doc-id](http://wiki.apache.org/couchdb/HTTP_Document_API#PUT). Saves a json `doc` with a given `id`.\n\n### db.saveDoc(doc)\n\nSame as the above, but the `id` can either a property of `doc`, or omitted to let CouchDB generate a uuid for this new document.\n\n### db.removeDoc(id, rev)\n\nDeletes document `id` with `rev` from the db.\n\n### db.copyDoc(srcId, destId, [destRev])\n\nCopies document `srcId` to `destId`. If `destId` already exists, you need to supply `destRev` to overwrite it.\n\n### db.bulkDocs(data)\n\nWrapper for [POST /db-name/\\_bulk_docs](http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Modify_Multiple_Documents_With_a_Single_Request).\n\n### db.saveDesign(design, doc)\n\nA convenience wrapper for `saveDoc()` that prefixes the document id with `'_design/'+design`. Useful for storing views like this:\n\n    db\n      .saveDesign('my-design', {\n        views: {\n          \"my-view\": {\n            map: function() {\n              emit(null, null)\n            }\n          }\n        }\n      })\n\n### db.saveAttachment(file, docId, options)\n\nAttaches a `file` to a given `docId`. Available `options`:\n\n* `name`: The name of the attachment. (default: `path.basename(file)`)\n* `contentType`: The content type to associate with this attachment (default: see `lib/dep/mime.js`)\n* `rev`: If the `docId` already exists, you have to supply its current revision.\n\n### db.removeAttachment(docId, attachmentId, docRev)\n\nDelete attachment `attachmentId` from doc `docId` with `docRev`.\n\n### db.getAttachment(docId, attachmentId, cb)\n\nLoads the attachment `attachmentId` from `docId`. The callback receivesthe binary content of the attachment. There is no streaming, don't use this with large files.\n\n### db.allDocs(query)\n\nWrapper for [GET /db-name/\\_all\\_docs](http://wiki.apache.org/couchdb/HTTP_Document_API#All_Documents). `query` allows to specify options for this view.\n\n### db.allDocsBySeq(query)\n\nWrapper for [GET /db-name/\\_all\\_docs\\_by\\_seq](http://wiki.apache.org/couchdb/HTTP_Document_API#all_docs_by_seq).\n\nReplaced by [GET /db-name/\\_changes](http://wiki.apache.org/couchdb/HTTP_database_API#Changes) as of CouchDB 0.11.\nConsider using `db.changes` or `db.changesStream`.\n\n### db.compact([design])\n\nWrapper for [POST /db-name/\\_compact/design-name](http://wiki.apache.org/couchdb/HTTP_view_API#View_Compaction). `design` provides the name of the design to invoke compact for, otherwise the whole db is used.\n\n### db.tempView(data, query)\n\nWrapper for [POST /db-name/\\_temp\\_view](http://wiki.apache.org/couchdb/HTTP_view_API#Temporary_Views).\n\n### db.viewCleanup(data, query)\n\nWrapper for [POST /db-name/\\_view\\_cleanup](http://wiki.apache.org/couchdb/HTTP_view_API#View_Cleanup).\n\n### db.view(design, view, [query], [cb])\n\nWrapper for [GET /db-name/\\_design/design-name/\\_view/view-name](http://wiki.apache.org/couchdb/HTTP_view_API#Access.2BAC8-Query). Fetches all documents for the given `design` and `view` with the specified `query` options.\n\n### db.list(design, list, view, [query], [cb])\n\nWrapper for [GET /db-name/\\_design/design-name/\\_list/list-name/view-name](http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Listing_Views_with_CouchDB_0.10_and_later). Fetches all documents for the given `design` and `view` with the specified `query` options.\n\n### db.changes([query])\n\nWrapper for [GET /db-name/\\_changes](http://wiki.apache.org/couchdb/HTTP_database_API#Changes). This can be used for long-polling or one-time retrieval from the changes feed. If you want to get a continuous stream of changes, use the `db.changesStream()` function instead.\n\n### db.changesStream([query])\n\nReturns an `events.EventEmitter` stream that emits the following events:\n\n* `data(change)`: Emitted for each change line in the stream. The `change` parameter holds the change object.\n* `heartbeat`: Emitted for each heartbeat send by CouchDB, no need to check this for most stuff.\n* `end(hadError)`: Emitted if the stream ends. This should not happen unless you manually invoke `stream.close()`.\n\nSee the [CouchDB docs](http://wiki.apache.org/couchdb/HTTP_database_API#Changes) for available `query` parameters.\n\n*Important:* This function uses its own http client for making requests, so unlike all other functions it does not go through the internal request queue.\n\n## Todo\n\n* http status, message and parsed body for errors\n* db.saveAttachment(file, docId, options) take file descriptor\n* Implement Authentication\n\n## Limitations\n\n* Streaming attachments is not supported at this point (patches welcome)\n* Etags are only available via client.request({full: true})\n\n","keywords":["couch","couchdb"],"readmeFilename":"README.md"}