couch-continuum
Advanced tools
Comparing version 1.0.1-alpha to 1.1.0-alpha
10
index.js
@@ -120,3 +120,2 @@ 'use strict' | ||
assert(dbName, 'The Continuum requires a target database.') | ||
assert(q, 'The Continuum requires a desired "q" setting.') | ||
this.url = couchUrl | ||
@@ -157,3 +156,3 @@ this.db1 = encodeURIComponent(dbName) | ||
_replicate (source, target) { | ||
_replicate (source, target, selector) { | ||
return makeRequest({ | ||
@@ -190,3 +189,3 @@ url: [this.url, source].join('/'), | ||
method: 'POST', | ||
json: { source, target } | ||
json: { source, target, selector } | ||
}).then(() => { | ||
@@ -213,3 +212,3 @@ bar.tick(total) | ||
]).then(([docCount1, docCount2]) => { | ||
assert(docCount1 <= docCount2, 'Primary and replica do not have the same number of documents.') | ||
assert.equal(docCount1, docCount2, 'Primary and replica do not have the same number of documents.') | ||
}) | ||
@@ -309,3 +308,4 @@ } | ||
log('[2/5] Beginning replication of primary to replica...') | ||
return this._replicate(this.db1, this.db2) | ||
const selector = { _deleted: { '$exists': false } } | ||
return this._replicate(this.db1, this.db2, selector) | ||
}).then(() => { | ||
@@ -312,0 +312,0 @@ log('[3/5] Verifying primary did not change during replication...') |
{ | ||
"name": "couch-continuum", | ||
"version": "1.0.1-alpha", | ||
"version": "1.1.0-alpha", | ||
"description": "Tool for migrating CouchDB databases to new configuration values.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,2 +31,4 @@ # couch-continuum | ||
Additionally, databases can accumulate [tombstones of deleted documents](http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid) that can slow down certain activities. CouchContinuum automatically filters out these tombstones when it migrates a database. | ||
## How it works | ||
@@ -33,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40637
165