I'm creating a view to obtain specifics values in my couchdb database, works fine in a little database, but when I have more than 1.5 Millions of records, an exception appears with: Socket hang up. I read other references like CouchDb unhandled 'error' event - Node js , but looks like if the error with the view. In the couchdb documentation never says about the max numbers of records in a view. Someone know what I can do to solve it. If I execute the view as temporaylly, the follow message appears: An error occurred querying the database (Only in the view with 1.5 millions of records).
Im using the follow codes to connect couchdb with node.js, for some reason, the code works with few records.
dbCouchdb.view("Where", "processId" , {key: "e2450051-b119-0ca7-d0be-fbae7887fea5", limit: 1}, function(err, body) {
console.log(err);
});
And the error:
{ [Error: error happened in your connection]
name: 'Error',
scope: 'socket',
errid: 'request',
code: 'ECONNRESET',
description: 'socket hang up',
stacktrace:
[ 'Error: socket hang up',
' at createHangUpError (http.js:1472:15)',
' at Socket.socketOnEnd [as onend] (http.js:1568:23)',
' at Socket.g (events.js:180:16)',
' at Socket.EventEmitter.emit (events.js:117:20)',
' at _stream_readable.js:920:16',
' at process._tickCallback (node.js:415:13)' ] }