Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caolan/highland-couchdb-alldocs
Provides Highland streams for reading all keys/docs in a CouchDB database
https://github.com/caolan/highland-couchdb-alldocs
Last synced: 11 days ago
JSON representation
Provides Highland streams for reading all keys/docs in a CouchDB database
- Host: GitHub
- URL: https://github.com/caolan/highland-couchdb-alldocs
- Owner: caolan
- Created: 2014-07-23T13:36:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-24T13:55:28.000Z (over 10 years ago)
- Last Synced: 2024-10-11T07:35:01.286Z (about 1 month ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# highland-couchdb-alldocs
Provides a [Highland](http://highlandjs.org) Streams API for iterating over
all ids or documents in a CouchDB database.```js
var alldocs = require('highland-couchr-alldocs');
var db = 'http://localhost:5984/mydb';// return a stream of all ids in 'mydb' fetching 100 ids at a time
alldocs.ids(db, 100).each(function (id) {
console.log('ID: ' + id);
});// return a stream of all documents in db, fetching 20 at a time
var docs = alldocs.docs(db, 20);// you can also use Highlands error handling methods,
// eg, stop processing on first request error:
docs.stopOnError(function (err) {
console.error('Something broke');
});
```