Easy interface to get object changes from CouchDb. This library is basically event emitter that emits changed objects, connection status and errors. If something happens with connection, it will be established again. Library checks also heartbeat and if new heartbeat is not received, connection will be reconnected. So Sit back and Relax, everything is taken care for you.
Key reasons why to choose this package are:
Options for initializing library.
database: Name of the database to use for this connection. (Mandatory)
host: The hostname of the database you are connecting to. (Default:
port: The port number to connect to. (Default:
protocol: Protocol used to connect to CouchDb.
includeDocs: Include the associated document with each result. (Default:
heartbeat: Period in milliseconds after which an empty line is sent in the results. (Default:
lastEventId: ID of the last events received by the server on a previous connection.
autoConnect: If it's true then connection is started on initializing, otherwise connect function has to be called. (Default:
user: The CouchDb user to authenticate as.
password: The password of that CouchDb user.
view: Allows to use view functions as filters. Documents counted as “passed” for view filter in case if map function emits at least one record for them
style: Specifies how many revisions are returned in the changes array. The default,
main_only, will only return the current “winning” revision;
all_docswill return all leaf revisions (including conflicts and deleted former conflicts).
const CouchdbChangeEvents = ;const couchdbEvents =database: 'my_database';couchdbEvents;couchdbEvents;couchdbEvents;
const CouchdbChangeEvents = ;const couchdbEvents =database: 'my_database'host: '127.0.0.1'user: 'username'password: 'secret';couchdbEvents;