Created
May 23, 2014 22:17
-
-
Save korczis/c3f7e5c38078c1b91538 to your computer and use it in GitHub Desktop.
Microcrawler CouchDB storage backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dbName = 'apollo-web-gui'; | |
var nano = require('nano')('http://localhost:5985'); | |
nano.db.create(dbName); | |
var db = nano.db.use(dbName); | |
// Register on data event handler | |
engine.on('data', function (result) { | |
logger.info('DATA: ' + JSON.stringify(result, null, 4)); | |
db.insert(result, null, function(err, body, header) { | |
if (err) { | |
console.log(err.message); | |
return; | |
} | |
}); | |
// Increment results counter | |
resultsCount++; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment