Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ function Replicator(sourceCredentials,
filtered: 0, // documents that were not copied because the filter condition was met
last_change_received: null, // timestamp for last change notification that was received from the source database
last_change_applied: null, // timestamp for last write operation in the target database
last_update_seq: 0 // CouchDB update_seq number for the last change that was written to the target database
last_update_seq: 0, // CouchDB update_seq number for the last change that was written to the target database
filter: {
server: null,
client: null
},
transformer: null
};

} // constructor
Expand Down Expand Up @@ -213,13 +218,27 @@ Replicator.prototype.init = function(initCallback) {
return initCallback(err);
}

this.stats.transformer = {
name : transformer.getName(),
definition : transformer.getRoutineDefinition()
};

// load filters, if configured
require('./filter.js').getFilter(sourceDb,
function(err, filter) {
if(err) {
return initCallback(err);
}

this.stats.filter.server = {
name : filter.getServerFilterName(),
definition : filter.getServerFilterDefinition()
};
this.stats.filter.client = {
name : filter.getClientFilterName(),
definition : filter.getClientFilterDefinition()
};

console.log('Replicator ready. Starting to listen for changes in database "' +
this.sourceCredentials.dbname + '". Changes will be applied to database "' +
this.targetCredentials.dbname + '".');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "couchdb-db-transform",
"version": "0.0.2",
"version": "0.0.3",
"description": "Fetches documents from one couchdb database, optionally transforms them and inserts them into target database",
"main": "app.js",
"scripts": {
Expand Down