From 6dab233ce4a320f948a024eba7a529a33ace7866 Mon Sep 17 00:00:00 2001 From: pubkey Date: Thu, 25 Jan 2018 17:58:58 +0100 Subject: [PATCH] 7.3.2 --- CHANGELOG.md | 8 +- dist/rxdb.browserify.js | 22146 +++++++++++++++-------------- dist/rxdb.browserify.min.js | 2 +- docs/contribute.html | 2 +- docs/custom-build.html | 2 +- docs/data-migration.html | 2 +- docs/in-memory.html | 2 +- docs/index.html | 2 +- docs/install.html | 2 +- docs/leader-election.html | 2 +- docs/middleware.html | 2 +- docs/orm.html | 2 +- docs/plugins.html | 2 +- docs/population.html | 4 +- docs/query-change-detection.html | 2 +- docs/replication.html | 2 +- docs/rx-attachment.html | 2 +- docs/rx-collection.html | 2 +- docs/rx-database.html | 2 +- docs/rx-document.html | 2 +- docs/rx-local-document.html | 2 +- docs/rx-query.html | 2 +- docs/rx-schema.html | 2 +- docs/search_index.json | 2 +- package.json | 2 +- 25 files changed, 11156 insertions(+), 11046 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ee02c966c..9a3226a5117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Changelog -### X.X.X (coming soon) +### 7.3.2 (January 25, 2018) + +Features: + - Upgraded to pouchdb 6.4.2. [Read this](https://pouchdb.com/2018/01/23/pouchdb-6.4.2.html) Typings: - Fix `RxCollection.findOne()` can return `null` +Other: + - Improved [react-native-example](https://github.com/pubkey/rxdb/tree/master/examples/react-native) thx [@Darkbladecr](https://github.com/Darkbladecr) + ### 7.3.1 (January 3, 2018) Bugfixes: diff --git a/dist/rxdb.browserify.js b/dist/rxdb.browserify.js index c2c33d711f4..51ac885bb5a 100644 --- a/dist/rxdb.browserify.js +++ b/dist/rxdb.browserify.js @@ -20,7 +20,7 @@ _index2['default'].plugin(require('pouchdb-adapter-http')); window['RxDB'] = _index2['default']; -},{"./index.js":8,"babel-polyfill":40,"pouchdb-adapter-http":507,"pouchdb-adapter-idb":509}],2:[function(require,module,exports){ +},{"./index.js":8,"babel-polyfill":40,"pouchdb-adapter-http":504,"pouchdb-adapter-idb":517}],2:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -974,7 +974,7 @@ exports['default'] = { create: create }; -},{"./crypter":4,"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-error":34,"./rx-schema":36,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"clone":60,"rxjs/Observable":553}],6:[function(require,module,exports){ +},{"./crypter":4,"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-error":34,"./rx-schema":36,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"clone":60,"rxjs/Observable":601}],6:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -2796,7 +2796,7 @@ exports['default'] = { }; }).call(this,require("buffer").Buffer) -},{"../rx-error":34,"./../rx-change-event":30,"./../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"buffer":59,"custom-idle-queue":487,"rxjs/operators/map":571}],15:[function(require,module,exports){ +},{"../rx-error":34,"./../rx-change-event":30,"./../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"buffer":59,"custom-idle-queue":487,"rxjs/operators/map":619}],15:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3485,7 +3485,7 @@ exports['default'] = { spawnInMemory: spawnInMemory }; -},{"../change-event-buffer":2,"../crypter":4,"../pouch-db":26,"../rx-collection":31,"../rx-error":34,"../rx-schema":36,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"rxjs/Subject":557}],18:[function(require,module,exports){ +},{"../change-event-buffer":2,"../crypter":4,"../pouch-db":26,"../rx-collection":31,"../rx-error":34,"../rx-schema":36,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"rxjs/Subject":605}],18:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -5002,7 +5002,7 @@ exports['default'] = { overwritable: overwritable }; -},{"../rx-broadcast-channel":29,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"rxjs/BehaviorSubject":550,"rxjs/operators/filter":569,"rxjs/operators/first":570,"unload":601}],21:[function(require,module,exports){ +},{"../rx-broadcast-channel":29,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"rxjs/BehaviorSubject":598,"rxjs/operators/filter":617,"rxjs/operators/first":618,"unload":649}],21:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -5581,7 +5581,7 @@ exports['default'] = { overwritable: overwritable }; -},{"../doc-cache":6,"../rx-change-event":30,"../rx-collection":31,"../rx-database":32,"../rx-document":33,"../rx-error":34,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/regenerator":57,"clone":60,"deep-equal":488,"object-path":503,"rxjs/operators/filter":569}],22:[function(require,module,exports){ +},{"../doc-cache":6,"../rx-change-event":30,"../rx-collection":31,"../rx-database":32,"../rx-document":33,"../rx-error":34,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/regenerator":57,"clone":60,"deep-equal":488,"object-path":503,"rxjs/operators/filter":617}],22:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -5910,7 +5910,7 @@ exports['default'] = { sync: sync }; -},{"../core":3,"../rx-change-event":30,"../rx-collection":31,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"clone":60,"pouchdb-replication":539,"rxjs/BehaviorSubject":550,"rxjs/Subject":557,"rxjs/observable/fromEvent":565,"rxjs/operators/delay":567,"rxjs/operators/filter":569,"rxjs/operators/map":571}],23:[function(require,module,exports){ +},{"../core":3,"../rx-change-event":30,"../rx-collection":31,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"clone":60,"pouchdb-replication":566,"rxjs/BehaviorSubject":598,"rxjs/Subject":605,"rxjs/observable/fromEvent":613,"rxjs/operators/delay":615,"rxjs/operators/filter":617,"rxjs/operators/map":619}],23:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -6504,7 +6504,7 @@ _pouchdbCore2['default'].getBatch = function (pouchdb, limit) { exports['default'] = _pouchdbCore2['default']; -},{"./rx-error":34,"pouchdb-core":522,"pouchdb-find":530}],27:[function(require,module,exports){ +},{"./rx-error":34,"pouchdb-core":533,"pouchdb-find":550}],27:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6953,7 +6953,7 @@ exports['default'] = { enable: enable }; -},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"object-path":503,"pouchdb-selector-core":541}],29:[function(require,module,exports){ +},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"object-path":503,"pouchdb-selector-core":582}],29:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7085,7 +7085,7 @@ exports['default'] = { canIUse: canIUse }; -},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/typeof":56,"rxjs/observable/fromEvent":565,"rxjs/operators/filter":569,"rxjs/operators/map":571}],30:[function(require,module,exports){ +},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/typeof":56,"rxjs/observable/fromEvent":613,"rxjs/operators/filter":617,"rxjs/operators/map":619}],30:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -8657,7 +8657,7 @@ exports['default'] = { RxCollection: RxCollection }; -},{"./change-event-buffer":2,"./crypter":4,"./data-migrator":5,"./doc-cache":6,"./hooks":7,"./overwritable":11,"./query-cache":27,"./rx-change-event":30,"./rx-document":33,"./rx-error":34,"./rx-query":35,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"custom-idle-queue":487,"rxjs/operators/filter":569}],32:[function(require,module,exports){ +},{"./change-event-buffer":2,"./crypter":4,"./data-migrator":5,"./doc-cache":6,"./hooks":7,"./overwritable":11,"./query-cache":27,"./rx-change-event":30,"./rx-document":33,"./rx-error":34,"./rx-query":35,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"custom-idle-queue":487,"rxjs/operators/filter":617}],32:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -9735,7 +9735,7 @@ exports['default'] = { dbCount: dbCount }; -},{"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-change-event":30,"./rx-collection":31,"./rx-error":34,"./rx-schema":36,"./socket":37,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/regenerator":57,"custom-idle-queue":487,"random-token":547,"rxjs/Subject":557,"rxjs/operators/filter":569}],33:[function(require,module,exports){ +},{"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-change-event":30,"./rx-collection":31,"./rx-error":34,"./rx-schema":36,"./socket":37,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/regenerator":57,"custom-idle-queue":487,"random-token":595,"rxjs/Subject":605,"rxjs/operators/filter":617}],33:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -10625,7 +10625,7 @@ exports['default'] = { isInstanceOf: isInstanceOf }; -},{"./hooks":7,"./rx-change-event":30,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"deep-equal":488,"object-path":503,"rxjs/BehaviorSubject":550,"rxjs/operators/distinctUntilChanged":568,"rxjs/operators/map":571}],34:[function(require,module,exports){ +},{"./hooks":7,"./rx-change-event":30,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"clone":60,"deep-equal":488,"object-path":503,"rxjs/BehaviorSubject":598,"rxjs/operators/distinctUntilChanged":616,"rxjs/operators/map":619}],34:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -11550,7 +11550,7 @@ exports['default'] = { isInstanceOf: isInstanceOf }; -},{"./hooks":7,"./mquery/mquery":9,"./query-change-detector":28,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/defineProperty":52,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"custom-idle-queue":487,"deep-equal":488,"rxjs/BehaviorSubject":550,"rxjs/observable/merge":566,"rxjs/operators/filter":569,"rxjs/operators/mergeMap":573}],36:[function(require,module,exports){ +},{"./hooks":7,"./mquery/mquery":9,"./query-change-detector":28,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/defineProperty":52,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"custom-idle-queue":487,"deep-equal":488,"rxjs/BehaviorSubject":598,"rxjs/observable/merge":614,"rxjs/operators/filter":617,"rxjs/operators/mergeMap":621}],36:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -12630,7 +12630,7 @@ exports['default'] = { PULL_TIME: PULL_TIME }; -},{"./rx-broadcast-channel":29,"./rx-change-event":30,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"rxjs/Subject":557,"rxjs/operators/filter":569}],38:[function(require,module,exports){ +},{"./rx-broadcast-channel":29,"./rx-change-event":30,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"rxjs/Subject":605,"rxjs/operators/filter":617}],38:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -13022,7 +13022,7 @@ function adapterObject(adapter) { return adapterObj; }; -},{"./rx-error":34,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"random-token":547,"spark-md5":599}],39:[function(require,module,exports){ +},{"./rx-error":34,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"random-token":595,"spark-md5":647}],39:[function(require,module,exports){ 'use strict'; module.exports = argsArray; @@ -14028,7 +14028,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d },{"../core-js/symbol":47,"../core-js/symbol/iterator":48}],57:[function(require,module,exports){ module.exports = require("regenerator-runtime"); -},{"regenerator-runtime":548}],58:[function(require,module,exports){ +},{"regenerator-runtime":596}],58:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -26701,7 +26701,7 @@ module.exports = function() { return line } -},{"util":605}],493:[function(require,module,exports){ +},{"util":653}],493:[function(require,module,exports){ var isProperty = require('is-property') var gen = function(obj, prop) { @@ -27447,7 +27447,7 @@ module.exports.filter = function(schema, opts) { } } -},{"./formats":496,"generate-function":492,"generate-object-property":493,"jsonpointer":499,"xtend":612}],498:[function(require,module,exports){ +},{"./formats":496,"generate-function":492,"generate-object-property":493,"jsonpointer":499,"xtend":655}],498:[function(require,module,exports){ "use strict" function isProperty(str) { return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str) @@ -28732,12906 +28732,13215 @@ module.exports = modify; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbCollections = require('pouchdb-collections'); var pouchdbUtils = require('pouchdb-utils'); +var ajaxCore = _interopDefault(require('pouchdb-ajax')); +var getArguments = _interopDefault(require('argsarray')); var pouchdbBinaryUtils = require('pouchdb-binary-utils'); -var pouchdbCollate = require('pouchdb-collate'); -var pouchdbMd5 = require('pouchdb-md5'); -var pouchdbMapreduceUtils = require('pouchdb-mapreduce-utils'); +var pouchdbErrors = require('pouchdb-errors'); -/* - * Simple task queue to sequentialize actions. Assumes - * callbacks will eventually fire (once). - */ +// dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool +// but much smaller in code size. limits the number of concurrent promises that are executed -function TaskQueue() { - this.promise = new Promise(function (fulfill) {fulfill(); }); +function pool(promiseFactories, limit) { + return new Promise(function (resolve, reject) { + var running = 0; + var current = 0; + var done = 0; + var len = promiseFactories.length; + var err; + + function runNext() { + running++; + promiseFactories[current++]().then(onSuccess, onError); + } + + function doNext() { + if (++done === len) { + /* istanbul ignore if */ + if (err) { + reject(err); + } else { + resolve(); + } + } else { + runNextBatch(); + } + } + + function onSuccess() { + running--; + doNext(); + } + + /* istanbul ignore next */ + function onError(thisErr) { + running--; + err = err || thisErr; + doNext(); + } + + function runNextBatch() { + while (running < limit && current < len) { + runNext(); + } + } + + runNextBatch(); + }); } -TaskQueue.prototype.add = function (promiseFactory) { - this.promise = this.promise.catch(function () { - // just recover - }).then(function () { - return promiseFactory(); + +var CHANGES_BATCH_SIZE = 25; +var MAX_SIMULTANEOUS_REVS = 50; +var CHANGES_TIMEOUT_BUFFER = 5000; +var DEFAULT_HEARTBEAT = 10000; + +var supportsBulkGetMap = {}; + +function readAttachmentsAsBlobOrBuffer(row) { + var doc = row.doc || row.ok; + var atts = doc._attachments; + if (!atts) { + return; + } + Object.keys(atts).forEach(function (filename) { + var att = atts[filename]; + att.data = pouchdbBinaryUtils.base64StringToBlobOrBuffer(att.data, att.content_type); }); - return this.promise; -}; -TaskQueue.prototype.finish = function () { - return this.promise; -}; +} -function stringify(input) { - if (!input) { - return 'undefined'; // backwards compat for empty reduce +function encodeDocId(id) { + if (/^_design/.test(id)) { + return '_design/' + encodeURIComponent(id.slice(8)); } - // for backwards compat with mapreduce, functions/strings are stringified - // as-is. everything else is JSON-stringified. - switch (typeof input) { - case 'function': - // e.g. a mapreduce map - return input.toString(); - case 'string': - // e.g. a mapreduce built-in _reduce function - return input.toString(); - default: - // e.g. a JSON object in the case of mango queries - return JSON.stringify(input); + if (/^_local/.test(id)) { + return '_local/' + encodeURIComponent(id.slice(7)); } + return encodeURIComponent(id); } -/* create a string signature for a view so we can cache it and uniq it */ -function createViewSignature(mapFun, reduceFun) { - // the "undefined" part is for backwards compatibility - return stringify(mapFun) + stringify(reduceFun) + 'undefined'; +function preprocessAttachments(doc) { + if (!doc._attachments || !Object.keys(doc._attachments)) { + return Promise.resolve(); + } + + return Promise.all(Object.keys(doc._attachments).map(function (key) { + var attachment = doc._attachments[key]; + if (attachment.data && typeof attachment.data !== 'string') { + return new Promise(function (resolve) { + pouchdbBinaryUtils.blobOrBufferToBase64(attachment.data, resolve); + }).then(function (b64) { + attachment.data = b64; + }); + } + })); } -function createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) { - var viewSignature = createViewSignature(mapFun, reduceFun); +function hasUrlPrefix(opts) { + if (!opts.prefix) { + return false; + } - var cachedViews; - if (!temporary) { - // cache this to ensure we don't try to update the same view twice - cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {}; - if (cachedViews[viewSignature]) { - return cachedViews[viewSignature]; - } + var protocol = pouchdbUtils.parseUri(opts.prefix).protocol; + + return protocol === 'http' || protocol === 'https'; +} + +// Get all the information you possibly can about the URI given by name and +// return it as a suitable object. +function getHost(name, opts) { + + // encode db name if opts.prefix is a url (#5574) + if (hasUrlPrefix(opts)) { + var dbName = opts.name.substr(opts.prefix.length); + name = opts.prefix + encodeURIComponent(dbName); } - var promiseForView = sourceDB.info().then(function (info) { + // Prase the URI into all its little bits + var uri = pouchdbUtils.parseUri(name); - var depDbName = info.db_name + '-mrview-' + - (temporary ? 'temp' : pouchdbMd5.stringMd5(viewSignature)); + // Store the user and password as a separate auth object + if (uri.user || uri.password) { + uri.auth = {username: uri.user, password: uri.password}; + } - // save the view name in the source db so it can be cleaned up if necessary - // (e.g. when the _design doc is deleted, remove all associated view data) - function diffFunction(doc) { - doc.views = doc.views || {}; - var fullViewName = viewName; - if (fullViewName.indexOf('/') === -1) { - fullViewName = viewName + '/' + viewName; - } - var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {}; - /* istanbul ignore if */ - if (depDbs[depDbName]) { - return; // no update necessary - } - depDbs[depDbName] = true; - return doc; - } - return pouchdbUtils.upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () { - return sourceDB.registerDependentDatabase(depDbName).then(function (res) { - var db = res.db; - db.auto_compaction = true; - var view = { - name: depDbName, - db: db, - sourceDB: sourceDB, - adapter: sourceDB.adapter, - mapFun: mapFun, - reduceFun: reduceFun - }; - return view.db.get('_local/lastSeq').catch(function (err) { - /* istanbul ignore if */ - if (err.status !== 404) { - throw err; - } - }).then(function (lastSeqDoc) { - view.seq = lastSeqDoc ? lastSeqDoc.seq : 0; - if (cachedViews) { - view.db.once('destroyed', function () { - delete cachedViews[viewSignature]; - }); - } - return view; - }); - }); - }); - }); + // Split the path part of the URI into parts using '/' as the delimiter + // after removing any leading '/' and any trailing '/' + var parts = uri.path.replace(/(^\/|\/$)/g, '').split('/'); - if (cachedViews) { - cachedViews[viewSignature] = promiseForView; + // Store the first part as the database name and remove it from the parts + // array + uri.db = parts.pop(); + // Prevent double encoding of URI component + if (uri.db.indexOf('%') === -1) { + uri.db = encodeURIComponent(uri.db); } - return promiseForView; -} -var persistentQueues = {}; -var tempViewQueue = new TaskQueue(); -var CHANGES_BATCH_SIZE = 50; + // Restore the path by joining all the remaining parts (all the parts + // except for the database name) with '/'s + uri.path = parts.join('/'); -function parseViewName(name) { - // can be either 'ddocname/viewname' or just 'viewname' - // (where the ddoc name is the same) - return name.indexOf('/') === -1 ? [name, name] : name.split('/'); + return uri; } -function isGenOne(changes) { - // only return true if the current change is 1- - // and there are no other leafs - return changes.length === 1 && /^1-/.test(changes[0].rev); +// Generate a URL with the host data given by opts and the given path +function genDBUrl(opts, path) { + return genUrl(opts, opts.db + '/' + path); } -function emitError(db, e) { - try { - db.emit('error', e); - } catch (err) { - pouchdbUtils.guardedConsole('error', - 'The user\'s map/reduce function threw an uncaught error.\n' + - 'You can debug this error by doing:\n' + - 'myDatabase.on(\'error\', function (err) { debugger; });\n' + - 'Please double-check your map/reduce function.'); - pouchdbUtils.guardedConsole('error', e); - } +// Generate a URL with the host data given by opts and the given path +function genUrl(opts, path) { + // If the host already has a path, then we need to have a path delimiter + // Otherwise, the path delimiter is the empty string + var pathDel = !opts.path ? '' : '/'; + + // If the host already has a path, then we need to have a path delimiter + // Otherwise, the path delimiter is the empty string + return opts.protocol + '://' + opts.host + + (opts.port ? (':' + opts.port) : '') + + '/' + opts.path + pathDel + path; } -/** - * Returns an "abstract" mapreduce object of the form: - * - * { - * query: queryFun, - * viewCleanup: viewCleanupFun - * } - * - * Arguments are: - * - * localDoc: string - * This is for the local doc that gets saved in order to track the - * "dependent" DBs and clean them up for viewCleanup. It should be - * unique, so that indexer plugins don't collide with each other. - * mapper: function (mapFunDef, emit) - * Returns a map function based on the mapFunDef, which in the case of - * normal map/reduce is just the de-stringified function, but may be - * something else, such as an object in the case of pouchdb-find. - * reducer: function (reduceFunDef) - * Ditto, but for reducing. Modules don't have to support reducing - * (e.g. pouchdb-find). - * ddocValidator: function (ddoc, viewName) - * Throws an error if the ddoc or viewName is not valid. - * This could be a way to communicate to the user that the configuration for the - * indexer is invalid. - */ -function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) { +function paramsToStr(params) { + return '?' + Object.keys(params).map(function (k) { + return k + '=' + encodeURIComponent(params[k]); + }).join('&'); +} - function tryMap(db, fun, doc) { - // emit an event if there was an error thrown by a map function. - // putting try/catches in a single function also avoids deoptimizations. - try { - fun(doc); - } catch (e) { - emitError(db, e); - } - } +// Implements the PouchDB API for dealing with CouchDB instances over HTTP +function HttpPouch(opts, callback) { - function tryReduce(db, fun, keys, values, rereduce) { - // same as above, but returning the result or an error. there are two separate - // functions to avoid extra memory allocations since the tryCode() case is used - // for custom map functions (common) vs this function, which is only used for - // custom reduce functions (rare) - try { - return {output : fun(keys, values, rereduce)}; - } catch (e) { - emitError(db, e); - return {error: e}; - } - } + // The functions that will be publicly available for HttpPouch + var api = this; - function sortByKeyThenValue(x, y) { - var keyCompare = pouchdbCollate.collate(x.key, y.key); - return keyCompare !== 0 ? keyCompare : pouchdbCollate.collate(x.value, y.value); - } + var host = getHost(opts.name, opts); + var dbUrl = genDBUrl(host, ''); - function sliceResults(results, limit, skip) { - skip = skip || 0; - if (typeof limit === 'number') { - return results.slice(skip, limit + skip); - } else if (skip > 0) { - return results.slice(skip); - } - return results; + opts = pouchdbUtils.clone(opts); + var ajaxOpts = opts.ajax || {}; + + if (opts.auth || host.auth) { + var nAuth = opts.auth || host.auth; + var str = nAuth.username + ':' + nAuth.password; + var token = pouchdbBinaryUtils.btoa(unescape(encodeURIComponent(str))); + ajaxOpts.headers = ajaxOpts.headers || {}; + ajaxOpts.headers.Authorization = 'Basic ' + token; } - function rowToDocId(row) { - var val = row.value; - // Users can explicitly specify a joined doc _id, or it - // defaults to the doc _id that emitted the key/value. - var docId = (val && typeof val === 'object' && val._id) || row.id; - return docId; + // Not strictly necessary, but we do this because numerous tests + // rely on swapping ajax in and out. + api._ajax = ajaxCore; + + function ajax(userOpts, options, callback) { + var reqAjax = (userOpts || {}).ajax || {}; + var reqOpts = pouchdbUtils.assign(pouchdbUtils.clone(ajaxOpts), reqAjax, options); + var defaultHeaders = pouchdbUtils.clone(ajaxOpts.headers || {}); + reqOpts.headers = pouchdbUtils.assign(defaultHeaders, reqAjax.headers, + options.headers || {}); + /* istanbul ignore if */ + if (api.constructor.listeners('debug').length) { + api.constructor.emit('debug', ['http', reqOpts.method, reqOpts.url]); + } + return api._ajax(reqOpts, callback); } - function readAttachmentsAsBlobOrBuffer(res) { - res.rows.forEach(function (row) { - var atts = row.doc && row.doc._attachments; - if (!atts) { - return; - } - Object.keys(atts).forEach(function (filename) { - var att = atts[filename]; - atts[filename].data = pouchdbBinaryUtils.base64StringToBlobOrBuffer(att.data, att.content_type); + function ajaxPromise(userOpts, opts) { + return new Promise(function (resolve, reject) { + ajax(userOpts, opts, function (err, res) { + /* istanbul ignore if */ + if (err) { + return reject(err); + } + resolve(res); }); }); } - function postprocessAttachments(opts) { - return function (res) { - if (opts.include_docs && opts.attachments && opts.binary) { - readAttachmentsAsBlobOrBuffer(res); - } - return res; - }; + function adapterFun(name, fun) { + return pouchdbUtils.adapterFun(name, getArguments(function (args) { + setup().then(function () { + return fun.apply(this, args); + }).catch(function (e) { + var callback = args.pop(); + callback(e); + }); + })); } - function addHttpParam(paramName, opts, params, asJson) { - // add an http param from opts to params, optionally json-encoded - var val = opts[paramName]; - if (typeof val !== 'undefined') { - if (asJson) { - val = encodeURIComponent(JSON.stringify(val)); - } - params.push(paramName + '=' + val); - } - } + var setupPromise; - function coerceInteger(integerCandidate) { - if (typeof integerCandidate !== 'undefined') { - var asNumber = Number(integerCandidate); - // prevents e.g. '1foo' or '1.1' being coerced to 1 - if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) { - return asNumber; - } else { - return integerCandidate; - } + function setup() { + // TODO: Remove `skipSetup` in favor of `skip_setup` in a future release + if (opts.skipSetup || opts.skip_setup) { + return Promise.resolve(); } - } - function coerceOptions(opts) { - opts.group_level = coerceInteger(opts.group_level); - opts.limit = coerceInteger(opts.limit); - opts.skip = coerceInteger(opts.skip); - return opts; - } + // If there is a setup in process or previous successful setup + // done then we will use that + // If previous setups have been rejected we will try again + if (setupPromise) { + return setupPromise; + } - function checkPositiveInteger(number) { - if (number) { - if (typeof number !== 'number') { - return new pouchdbMapreduceUtils.QueryParseError('Invalid value for integer: "' + - number + '"'); + var checkExists = {method: 'GET', url: dbUrl}; + setupPromise = ajaxPromise({}, checkExists).catch(function (err) { + if (err && err.status && err.status === 404) { + // Doesnt exist, create it + pouchdbUtils.explainError(404, 'PouchDB is just detecting if the remote exists.'); + return ajaxPromise({}, {method: 'PUT', url: dbUrl}); + } else { + return Promise.reject(err); } - if (number < 0) { - return new pouchdbMapreduceUtils.QueryParseError('Invalid value for positive integer: ' + - '"' + number + '"'); + }).catch(function (err) { + // If we try to create a database that already exists, skipped in + // istanbul since its catching a race condition. + /* istanbul ignore if */ + if (err && err.status && err.status === 412) { + return true; } - } + return Promise.reject(err); + }); + + setupPromise.catch(function () { + setupPromise = null; + }); + + return setupPromise; } - function checkQueryParseError(options, fun) { - var startkeyName = options.descending ? 'endkey' : 'startkey'; - var endkeyName = options.descending ? 'startkey' : 'endkey'; + pouchdbUtils.nextTick(function () { + callback(null, api); + }); - if (typeof options[startkeyName] !== 'undefined' && - typeof options[endkeyName] !== 'undefined' && - pouchdbCollate.collate(options[startkeyName], options[endkeyName]) > 0) { - throw new pouchdbMapreduceUtils.QueryParseError('No rows can match your key range, ' + - 'reverse your start_key and end_key or set {descending : true}'); - } else if (fun.reduce && options.reduce !== false) { - if (options.include_docs) { - throw new pouchdbMapreduceUtils.QueryParseError('{include_docs:true} is invalid for reduce'); - } else if (options.keys && options.keys.length > 1 && - !options.group && !options.group_level) { - throw new pouchdbMapreduceUtils.QueryParseError('Multi-key fetches for reduce views must use ' + - '{group: true}'); - } - } - ['group_level', 'limit', 'skip'].forEach(function (optionName) { - var error = checkPositiveInteger(options[optionName]); - if (error) { - throw error; - } + api._remote = true; + /* istanbul ignore next */ + api.type = function () { + return 'http'; + }; + + api.id = adapterFun('id', function (callback) { + ajax({}, {method: 'GET', url: genUrl(host, '')}, function (err, result) { + var uuid = (result && result.uuid) ? + (result.uuid + host.db) : genDBUrl(host, ''); + callback(null, uuid); }); - } + }); - function httpQuery(db, fun, opts) { - // List of parameters to add to the PUT request - var params = []; - var body; - var method = 'GET'; + api.request = adapterFun('request', function (options, callback) { + options.url = genDBUrl(host, options.url); + ajax({}, options, callback); + }); - // If opts.reduce exists and is defined, then add it to the list - // of parameters. - // If reduce=false then the results are that of only the map function - // not the final result of map and reduce. - addHttpParam('reduce', opts, params); - addHttpParam('include_docs', opts, params); - addHttpParam('attachments', opts, params); - addHttpParam('limit', opts, params); - addHttpParam('descending', opts, params); - addHttpParam('group', opts, params); - addHttpParam('group_level', opts, params); - addHttpParam('skip', opts, params); - addHttpParam('stale', opts, params); - addHttpParam('conflicts', opts, params); - addHttpParam('startkey', opts, params, true); - addHttpParam('start_key', opts, params, true); - addHttpParam('endkey', opts, params, true); - addHttpParam('end_key', opts, params, true); - addHttpParam('inclusive_end', opts, params); - addHttpParam('key', opts, params, true); - addHttpParam('update_seq', opts, params); - - // Format the list of parameters into a valid URI query string - params = params.join('&'); - params = params === '' ? '' : '?' + params; + // Sends a POST request to the host calling the couchdb _compact function + // version: The version of CouchDB it is running + api.compact = adapterFun('compact', function (opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + opts = pouchdbUtils.clone(opts); + ajax(opts, { + url: genDBUrl(host, '_compact'), + method: 'POST' + }, function () { + function ping() { + api.info(function (err, res) { + // CouchDB may send a "compact_running:true" if it's + // already compacting. PouchDB Server doesn't. + /* istanbul ignore else */ + if (res && !res.compact_running) { + callback(null, {ok: true}); + } else { + setTimeout(ping, opts.interval || 200); + } + }); + } + // Ping the http if it's finished compaction + ping(); + }); + }); - // If keys are supplied, issue a POST to circumvent GET query string limits - // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options - if (typeof opts.keys !== 'undefined') { - var MAX_URL_LENGTH = 2000; - // according to http://stackoverflow.com/a/417184/680742, - // the de facto URL length limit is 2000 characters + api.bulkGet = pouchdbUtils.adapterFun('bulkGet', function (opts, callback) { + var self = this; - var keysAsString = - 'keys=' + encodeURIComponent(JSON.stringify(opts.keys)); - if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) { - // If the keys are short enough, do a GET. we do this to work around - // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239) - params += (params[0] === '?' ? '&' : '?') + keysAsString; - } else { - method = 'POST'; - if (typeof fun === 'string') { - body = {keys: opts.keys}; - } else { // fun is {map : mapfun}, so append to this - fun.keys = opts.keys; - } + function doBulkGet(cb) { + var params = {}; + if (opts.revs) { + params.revs = true; } - } - - // We are referencing a query defined in the design doc - if (typeof fun === 'string') { - var parts = parseViewName(fun); - return db.request({ - method: method, - url: '_design/' + parts[0] + '/_view/' + parts[1] + params, - body: body - }).then( + if (opts.attachments) { /* istanbul ignore next */ - function (result) { - // fail the entire request if the result contains an error - result.rows.forEach(function (row) { - if (row.value && row.value.error && row.value.error === "builtin_reduce_error") { - throw new Error(row.reason); - } - }); - - return result; - }) - .then(postprocessAttachments(opts)); - } - - // We are using a temporary view, terrible for performance, good for testing - body = body || {}; - Object.keys(fun).forEach(function (key) { - if (Array.isArray(fun[key])) { - body[key] = fun[key]; - } else { - body[key] = fun[key].toString(); + params.attachments = true; } - }); - return db.request({ - method: 'POST', - url: '_temp_view' + params, - body: body - }).then(postprocessAttachments(opts)); - } - - // custom adapters can define their own api._query - // and override the default behavior - /* istanbul ignore next */ - function customQuery(db, fun, opts) { - return new Promise(function (resolve, reject) { - db._query(fun, opts, function (err, res) { - if (err) { - return reject(err); + if (opts.latest) { + params.latest = true; + } + ajax(opts, { + url: genDBUrl(host, '_bulk_get' + paramsToStr(params)), + method: 'POST', + body: { docs: opts.docs} + }, function (err, result) { + if (!err && opts.attachments && opts.binary) { + result.results.forEach(function (res) { + res.docs.forEach(readAttachmentsAsBlobOrBuffer); + }); } - resolve(res); + cb(err, result); }); - }); - } + } - // custom adapters can define their own api._viewCleanup - // and override the default behavior - /* istanbul ignore next */ - function customViewCleanup(db) { - return new Promise(function (resolve, reject) { - db._viewCleanup(function (err, res) { - if (err) { - return reject(err); - } - resolve(res); - }); - }); - } + /* istanbul ignore next */ + function doBulkGetShim() { + // avoid "url too long error" by splitting up into multiple requests + var batchSize = MAX_SIMULTANEOUS_REVS; + var numBatches = Math.ceil(opts.docs.length / batchSize); + var numDone = 0; + var results = new Array(numBatches); - function defaultsTo(value) { - return function (reason) { - /* istanbul ignore else */ - if (reason.status === 404) { - return value; - } else { - throw reason; + function onResult(batchNum) { + return function (err, res) { + // err is impossible because shim returns a list of errs in that case + results[batchNum] = res.results; + if (++numDone === numBatches) { + callback(null, {results: pouchdbUtils.flatten(results)}); + } + }; } - }; - } - - // returns a promise for a list of docs to update, based on the input docId. - // the order doesn't matter, because post-3.2.0, bulkDocs - // is an atomic operation in all three adapters. - function getDocsToPersist(docId, view, docIdsToChangesAndEmits) { - var metaDocId = '_local/doc_' + docId; - var defaultMetaDoc = {_id: metaDocId, keys: []}; - var docData = docIdsToChangesAndEmits.get(docId); - var indexableKeysToKeyValues = docData[0]; - var changes = docData[1]; - function getMetaDoc() { - if (isGenOne(changes)) { - // generation 1, so we can safely assume initial state - // for performance reasons (avoids unnecessary GETs) - return Promise.resolve(defaultMetaDoc); + for (var i = 0; i < numBatches; i++) { + var subOpts = pouchdbUtils.pick(opts, ['revs', 'attachments', 'binary', 'latest']); + subOpts.ajax = ajaxOpts; + subOpts.docs = opts.docs.slice(i * batchSize, + Math.min(opts.docs.length, (i + 1) * batchSize)); + pouchdbUtils.bulkGetShim(self, subOpts, onResult(i)); } - return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc)); } - function getKeyValueDocs(metaDoc) { - if (!metaDoc.keys.length) { - // no keys, no need for a lookup - return Promise.resolve({rows: []}); - } - return view.db.allDocs({ - keys: metaDoc.keys, - include_docs: true + // mark the whole database as either supporting or not supporting _bulk_get + var dbUrl = genUrl(host, ''); + var supportsBulkGet = supportsBulkGetMap[dbUrl]; + + /* istanbul ignore next */ + if (typeof supportsBulkGet !== 'boolean') { + // check if this database supports _bulk_get + doBulkGet(function (err, res) { + if (err) { + supportsBulkGetMap[dbUrl] = false; + pouchdbUtils.explainError( + err.status, + 'PouchDB is just detecting if the remote ' + + 'supports the _bulk_get API.' + ); + doBulkGetShim(); + } else { + supportsBulkGetMap[dbUrl] = true; + callback(null, res); + } }); + } else if (supportsBulkGet) { + doBulkGet(callback); + } else { + doBulkGetShim(); } + }); - function processKeyValueDocs(metaDoc, kvDocsRes) { - var kvDocs = []; - var oldKeys = new pouchdbCollections.Set(); - - for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) { - var row = kvDocsRes.rows[i]; - var doc = row.doc; - if (!doc) { // deleted - continue; - } - kvDocs.push(doc); - oldKeys.add(doc._id); - doc._deleted = !indexableKeysToKeyValues.has(doc._id); - if (!doc._deleted) { - var keyValue = indexableKeysToKeyValues.get(doc._id); - if ('value' in keyValue) { - doc.value = keyValue.value; - } - } - } - var newKeys = pouchdbMapreduceUtils.mapToKeysArray(indexableKeysToKeyValues); - newKeys.forEach(function (key) { - if (!oldKeys.has(key)) { - // new doc - var kvDoc = { - _id: key - }; - var keyValue = indexableKeysToKeyValues.get(key); - if ('value' in keyValue) { - kvDoc.value = keyValue.value; - } - kvDocs.push(kvDoc); + // Calls GET on the host, which gets back a JSON string containing + // couchdb: A welcome string + // version: The version of CouchDB it is running + api._info = function (callback) { + setup().then(function () { + ajax({}, { + method: 'GET', + url: genDBUrl(host, '') + }, function (err, res) { + /* istanbul ignore next */ + if (err) { + return callback(err); } + res.host = genDBUrl(host, ''); + callback(null, res); }); - metaDoc.keys = pouchdbMapreduceUtils.uniq(newKeys.concat(metaDoc.keys)); - kvDocs.push(metaDoc); + }).catch(callback); + }; - return kvDocs; + // Get the document with the given id from the database given by host. + // The id could be solely the _id in the database, or it may be a + // _design/ID or _local/ID path + api.get = adapterFun('get', function (id, opts, callback) { + // If no options were given, set the callback to the second parameter + if (typeof opts === 'function') { + callback = opts; + opts = {}; } + opts = pouchdbUtils.clone(opts); - return getMetaDoc().then(function (metaDoc) { - return getKeyValueDocs(metaDoc).then(function (kvDocsRes) { - return processKeyValueDocs(metaDoc, kvDocsRes); - }); - }); - } - - // updates all emitted key/value docs and metaDocs in the mrview database - // for the given batch of documents from the source database - function saveKeyValues(view, docIdsToChangesAndEmits, seq) { - var seqDocId = '_local/lastSeq'; - return view.db.get(seqDocId) - .catch(defaultsTo({_id: seqDocId, seq: 0})) - .then(function (lastSeqDoc) { - var docIds = pouchdbMapreduceUtils.mapToKeysArray(docIdsToChangesAndEmits); - return Promise.all(docIds.map(function (docId) { - return getDocsToPersist(docId, view, docIdsToChangesAndEmits); - })).then(function (listOfDocsToPersist) { - var docsToPersist = pouchdbUtils.flatten(listOfDocsToPersist); - lastSeqDoc.seq = seq; - docsToPersist.push(lastSeqDoc); - // write all docs in a single operation, update the seq once - return view.db.bulkDocs({docs : docsToPersist}); - }); - }); - } + // List of parameters to add to the GET request + var params = {}; - function getQueue(view) { - var viewName = typeof view === 'string' ? view : view.name; - var queue = persistentQueues[viewName]; - if (!queue) { - queue = persistentQueues[viewName] = new TaskQueue(); + if (opts.revs) { + params.revs = true; } - return queue; - } - function updateView(view) { - return pouchdbMapreduceUtils.sequentialize(getQueue(view), function () { - return updateViewInQueue(view); - })(); - } + if (opts.revs_info) { + params.revs_info = true; + } - function updateViewInQueue(view) { - // bind the emit function once - var mapResults; - var doc; + if (opts.latest) { + params.latest = true; + } - function emit(key, value) { - var output = {id: doc._id, key: pouchdbCollate.normalizeKey(key)}; - // Don't explicitly store the value unless it's defined and non-null. - // This saves on storage space, because often people don't use it. - if (typeof value !== 'undefined' && value !== null) { - output.value = pouchdbCollate.normalizeKey(value); + if (opts.open_revs) { + if (opts.open_revs !== "all") { + opts.open_revs = JSON.stringify(opts.open_revs); } - mapResults.push(output); + params.open_revs = opts.open_revs; } - var mapFun = mapper(view.mapFun, emit); + if (opts.rev) { + params.rev = opts.rev; + } - var currentSeq = view.seq || 0; + if (opts.conflicts) { + params.conflicts = opts.conflicts; + } - function processChange(docIdsToChangesAndEmits, seq) { - return function () { - return saveKeyValues(view, docIdsToChangesAndEmits, seq); - }; + /* istanbul ignore if */ + if (opts.update_seq) { + params.update_seq = opts.update_seq; } - var queue = new TaskQueue(); + id = encodeDocId(id); - function processNextBatch() { - return view.sourceDB.changes({ - conflicts: true, - include_docs: true, - style: 'all_docs', - since: currentSeq, - limit: CHANGES_BATCH_SIZE - }).then(processBatch); - } + // Set the options for the ajax call + var options = { + method: 'GET', + url: genDBUrl(host, id + paramsToStr(params)) + }; - function processBatch(response) { - var results = response.results; - if (!results.length) { + function fetchAttachments(doc) { + var atts = doc._attachments; + var filenames = atts && Object.keys(atts); + if (!atts || !filenames.length) { return; } - var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results); - queue.add(processChange(docIdsToChangesAndEmits, currentSeq)); - if (results.length < CHANGES_BATCH_SIZE) { - return; + // we fetch these manually in separate XHRs, because + // Sync Gateway would normally send it back as multipart/mixed, + // which we cannot parse. Also, this is more efficient than + // receiving attachments as base64-encoded strings. + function fetch(filename) { + var att = atts[filename]; + var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) + + '?rev=' + doc._rev; + return ajaxPromise(opts, { + method: 'GET', + url: genDBUrl(host, path), + binary: true + }).then(function (blob) { + if (opts.binary) { + return blob; + } + return new Promise(function (resolve) { + pouchdbBinaryUtils.blobOrBufferToBase64(blob, resolve); + }); + }).then(function (data) { + delete att.stub; + delete att.length; + att.data = data; + }); } - return processNextBatch(); - } - - function createDocIdsToChangesAndEmits(results) { - var docIdsToChangesAndEmits = new pouchdbCollections.Map(); - for (var i = 0, len = results.length; i < len; i++) { - var change = results[i]; - if (change.doc._id[0] !== '_') { - mapResults = []; - doc = change.doc; - if (!doc._deleted) { - tryMap(view.sourceDB, mapFun, doc); - } - mapResults.sort(sortByKeyThenValue); + var promiseFactories = filenames.map(function (filename) { + return function () { + return fetch(filename); + }; + }); - var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults); - docIdsToChangesAndEmits.set(change.doc._id, [ - indexableKeysToKeyValues, - change.changes - ]); - } - currentSeq = change.seq; - } - return docIdsToChangesAndEmits; + // This limits the number of parallel xhr requests to 5 any time + // to avoid issues with maximum browser request limits + return pool(promiseFactories, 5); } - function createIndexableKeysToKeyValues(mapResults) { - var indexableKeysToKeyValues = new pouchdbCollections.Map(); - var lastKey; - for (var i = 0, len = mapResults.length; i < len; i++) { - var emittedKeyValue = mapResults[i]; - var complexKey = [emittedKeyValue.key, emittedKeyValue.id]; - if (i > 0 && pouchdbCollate.collate(emittedKeyValue.key, lastKey) === 0) { - complexKey.push(i); // dup key+id, so make it unique - } - indexableKeysToKeyValues.set(pouchdbCollate.toIndexableString(complexKey), emittedKeyValue); - lastKey = emittedKeyValue.key; + function fetchAllAttachments(docOrDocs) { + if (Array.isArray(docOrDocs)) { + return Promise.all(docOrDocs.map(function (doc) { + if (doc.ok) { + return fetchAttachments(doc.ok); + } + })); } - return indexableKeysToKeyValues; + return fetchAttachments(docOrDocs); } - return processNextBatch().then(function () { - return queue.finish(); - }).then(function () { - view.seq = currentSeq; + ajaxPromise(opts, options).then(function (res) { + return Promise.resolve().then(function () { + if (opts.attachments) { + return fetchAllAttachments(res); + } + }).then(function () { + callback(null, res); + }); + }).catch(function (e) { + e.docId = id; + callback(e); }); - } + }); - function reduceView(view, results, options) { - if (options.group_level === 0) { - delete options.group_level; + // Delete the document given by doc from the database given by host. + api.remove = adapterFun('remove', + function (docOrId, optsOrRev, opts, callback) { + var doc; + if (typeof optsOrRev === 'string') { + // id, rev, opts, callback style + doc = { + _id: docOrId, + _rev: optsOrRev + }; + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + } else { + // doc, opts, callback style + doc = docOrId; + if (typeof optsOrRev === 'function') { + callback = optsOrRev; + opts = {}; + } else { + callback = opts; + opts = optsOrRev; + } } - var shouldGroup = options.group || options.group_level; - - var reduceFun = reducer(view.reduceFun); - - var groups = []; - var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY : - options.group_level; - results.forEach(function (e) { - var last = groups[groups.length - 1]; - var groupKey = shouldGroup ? e.key : null; - - // only set group_level for array keys - if (shouldGroup && Array.isArray(groupKey)) { - groupKey = groupKey.slice(0, lvl); - } + var rev = (doc._rev || opts.rev); - if (last && pouchdbCollate.collate(last.groupKey, groupKey) === 0) { - last.keys.push([e.key, e.id]); - last.values.push(e.value); - return; - } - groups.push({ - keys: [[e.key, e.id]], - values: [e.value], - groupKey: groupKey - }); - }); - results = []; - for (var i = 0, len = groups.length; i < len; i++) { - var e = groups[i]; - var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false); - if (reduceTry.error && reduceTry.error instanceof pouchdbMapreduceUtils.BuiltInError) { - // CouchDB returns an error if a built-in errors out - throw reduceTry.error; - } - results.push({ - // CouchDB just sets the value to null if a non-built-in errors out - value: reduceTry.error ? null : reduceTry.output, - key: e.groupKey - }); - } - // no total_rows/offset when reducing - return {rows: sliceResults(results, options.limit, options.skip)}; - } + // Delete the document + ajax(opts, { + method: 'DELETE', + url: genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev + }, callback); + }); - function queryView(view, opts) { - return pouchdbMapreduceUtils.sequentialize(getQueue(view), function () { - return queryViewInQueue(view, opts); - })(); + function encodeAttachmentId(attachmentId) { + return attachmentId.split("/").map(encodeURIComponent).join("/"); } - function queryViewInQueue(view, opts) { - var totalRows; - var shouldReduce = view.reduceFun && opts.reduce !== false; - var skip = opts.skip || 0; - if (typeof opts.keys !== 'undefined' && !opts.keys.length) { - // equivalent query - opts.limit = 0; - delete opts.keys; + // Get the attachment + api.getAttachment = + adapterFun('getAttachment', function (docId, attachmentId, opts, + callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; } + var params = opts.rev ? ('?rev=' + opts.rev) : ''; + var url = genDBUrl(host, encodeDocId(docId)) + '/' + + encodeAttachmentId(attachmentId) + params; + ajax(opts, { + method: 'GET', + url: url, + binary: true + }, callback); + }); - function fetchFromView(viewOpts) { - viewOpts.include_docs = true; - return view.db.allDocs(viewOpts).then(function (res) { - totalRows = res.total_rows; - return res.rows.map(function (result) { + // Remove the attachment given by the id and rev + api.removeAttachment = + adapterFun('removeAttachment', function (docId, attachmentId, rev, + callback) { - // implicit migration - in older versions of PouchDB, - // we explicitly stored the doc as {id: ..., key: ..., value: ...} - // this is tested in a migration test - /* istanbul ignore next */ - if ('value' in result.doc && typeof result.doc.value === 'object' && - result.doc.value !== null) { - var keys = Object.keys(result.doc.value).sort(); - // this detection method is not perfect, but it's unlikely the user - // emitted a value which was an object with these 3 exact keys - var expectedKeys = ['id', 'key', 'value']; - if (!(keys < expectedKeys || keys > expectedKeys)) { - return result.doc.value; - } - } + var url = genDBUrl(host, encodeDocId(docId) + '/' + + encodeAttachmentId(attachmentId)) + '?rev=' + rev; - var parsedKeyAndDocId = pouchdbCollate.parseIndexableString(result.doc._id); - return { - key: parsedKeyAndDocId[0], - id: parsedKeyAndDocId[1], - value: ('value' in result.doc ? result.doc.value : null) - }; - }); - }); - } + ajax({}, { + method: 'DELETE', + url: url + }, callback); + }); - function onMapResultsReady(rows) { - var finalResults; - if (shouldReduce) { - finalResults = reduceView(view, rows, opts); - } else { - finalResults = { - total_rows: totalRows, - offset: skip, - rows: rows - }; - } - /* istanbul ignore if */ - if (opts.update_seq) { - finalResults.update_seq = view.seq; - } - if (opts.include_docs) { - var docIds = pouchdbMapreduceUtils.uniq(rows.map(rowToDocId)); + // Add the attachment given by blob and its contentType property + // to the document with the given id, the revision given by rev, and + // add it to the database given by host. + api.putAttachment = + adapterFun('putAttachment', function (docId, attachmentId, rev, blob, + type, callback) { + if (typeof type === 'function') { + callback = type; + type = blob; + blob = rev; + rev = null; + } + var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId); + var url = genDBUrl(host, id); + if (rev) { + url += '?rev=' + rev; + } - return view.sourceDB.allDocs({ - keys: docIds, - include_docs: true, - conflicts: opts.conflicts, - attachments: opts.attachments, - binary: opts.binary - }).then(function (allDocsRes) { - var docIdsToDocs = new pouchdbCollections.Map(); - allDocsRes.rows.forEach(function (row) { - docIdsToDocs.set(row.id, row.doc); - }); - rows.forEach(function (row) { - var docId = rowToDocId(row); - var doc = docIdsToDocs.get(docId); - if (doc) { - row.doc = doc; - } - }); - return finalResults; - }); - } else { - return finalResults; + if (typeof blob === 'string') { + // input is assumed to be a base64 string + var binary; + try { + binary = pouchdbBinaryUtils.atob(blob); + } catch (err) { + return callback(pouchdbErrors.createError(pouchdbErrors.BAD_ARG, + 'Attachment is not a valid base64 string')); } + blob = binary ? pouchdbBinaryUtils.binaryStringToBlobOrBuffer(binary, type) : ''; } - if (typeof opts.keys !== 'undefined') { - var keys = opts.keys; - var fetchPromises = keys.map(function (key) { - var viewOpts = { - startkey : pouchdbCollate.toIndexableString([key]), - endkey : pouchdbCollate.toIndexableString([key, {}]) - }; - /* istanbul ignore if */ - if (opts.update_seq) { - viewOpts.update_seq = true; - } - return fetchFromView(viewOpts); - }); - return Promise.all(fetchPromises).then(pouchdbUtils.flatten).then(onMapResultsReady); - } else { // normal query, no 'keys' - var viewOpts = { - descending : opts.descending - }; - /* istanbul ignore if */ - if (opts.update_seq) { - viewOpts.update_seq = true; - } - var startkey; - var endkey; - if ('start_key' in opts) { - startkey = opts.start_key; - } - if ('startkey' in opts) { - startkey = opts.startkey; - } - if ('end_key' in opts) { - endkey = opts.end_key; - } - if ('endkey' in opts) { - endkey = opts.endkey; - } - if (typeof startkey !== 'undefined') { - viewOpts.startkey = opts.descending ? - pouchdbCollate.toIndexableString([startkey, {}]) : - pouchdbCollate.toIndexableString([startkey]); - } - if (typeof endkey !== 'undefined') { - var inclusiveEnd = opts.inclusive_end !== false; - if (opts.descending) { - inclusiveEnd = !inclusiveEnd; - } + var opts = { + headers: {'Content-Type': type}, + method: 'PUT', + url: url, + processData: false, + body: blob, + timeout: ajaxOpts.timeout || 60000 + }; + // Add the attachment + ajax({}, opts, callback); + }); - viewOpts.endkey = pouchdbCollate.toIndexableString( - inclusiveEnd ? [endkey, {}] : [endkey]); - } - if (typeof opts.key !== 'undefined') { - var keyStart = pouchdbCollate.toIndexableString([opts.key]); - var keyEnd = pouchdbCollate.toIndexableString([opts.key, {}]); - if (viewOpts.descending) { - viewOpts.endkey = keyStart; - viewOpts.startkey = keyEnd; - } else { - viewOpts.startkey = keyStart; - viewOpts.endkey = keyEnd; - } - } - if (!shouldReduce) { - if (typeof opts.limit === 'number') { - viewOpts.limit = opts.limit; + // Update/create multiple documents given by req in the database + // given by host. + api._bulkDocs = function (req, opts, callback) { + // If new_edits=false then it prevents the database from creating + // new revision numbers for the documents. Instead it just uses + // the old ones. This is used in database replication. + req.new_edits = opts.new_edits; + + setup().then(function () { + return Promise.all(req.docs.map(preprocessAttachments)); + }).then(function () { + // Update/create the documents + ajax(opts, { + method: 'POST', + url: genDBUrl(host, '_bulk_docs'), + timeout: opts.timeout, + body: req + }, function (err, results) { + if (err) { + return callback(err); } - viewOpts.skip = skip; - } - return fetchFromView(viewOpts).then(onMapResultsReady); - } - } + results.forEach(function (result) { + result.ok = true; // smooths out cloudant not adding this + }); + callback(null, results); + }); + }).catch(callback); + }; - function httpViewCleanup(db) { - return db.request({ - method: 'POST', - url: '_view_cleanup' - }); - } - function localViewCleanup(db) { - return db.get('_local/' + localDocName).then(function (metaDoc) { - var docsToViews = new pouchdbCollections.Map(); - Object.keys(metaDoc.views).forEach(function (fullViewName) { - var parts = parseViewName(fullViewName); - var designDocName = '_design/' + parts[0]; - var viewName = parts[1]; - var views = docsToViews.get(designDocName); - if (!views) { - views = new pouchdbCollections.Set(); - docsToViews.set(designDocName, views); + // Update/create document + api._put = function (doc, opts, callback) { + setup().then(function () { + return preprocessAttachments(doc); + }).then(function () { + // Update/create the document + ajax(opts, { + method: 'PUT', + url: genDBUrl(host, encodeDocId(doc._id)), + body: doc + }, function (err, result) { + if (err) { + err.docId = doc && doc._id; + return callback(err); } - views.add(viewName); - }); - var opts = { - keys : pouchdbMapreduceUtils.mapToKeysArray(docsToViews), - include_docs : true - }; - return db.allDocs(opts).then(function (res) { - var viewsToStatus = {}; - res.rows.forEach(function (row) { - var ddocName = row.key.substring(8); // cuts off '_design/' - docsToViews.get(row.key).forEach(function (viewName) { - var fullViewName = ddocName + '/' + viewName; - /* istanbul ignore if */ - if (!metaDoc.views[fullViewName]) { - // new format, without slashes, to support PouchDB 2.2.0 - // migration test in pouchdb's browser.migration.js verifies this - fullViewName = viewName; - } - var viewDBNames = Object.keys(metaDoc.views[fullViewName]); - // design doc deleted, or view function nonexistent - var statusIsGood = row.doc && row.doc.views && - row.doc.views[viewName]; - viewDBNames.forEach(function (viewDBName) { - viewsToStatus[viewDBName] = - viewsToStatus[viewDBName] || statusIsGood; - }); - }); - }); - var dbsToDelete = Object.keys(viewsToStatus).filter( - function (viewDBName) { return !viewsToStatus[viewDBName]; }); - var destroyPromises = dbsToDelete.map(function (viewDBName) { - return pouchdbMapreduceUtils.sequentialize(getQueue(viewDBName), function () { - return new db.constructor(viewDBName, db.__opts).destroy(); - })(); - }); - return Promise.all(destroyPromises).then(function () { - return {ok: true}; - }); + callback(null, result); }); - }, defaultsTo({ok: true})); - } + }).catch(callback); + }; - function queryPromised(db, fun, opts) { - /* istanbul ignore next */ - if (typeof db._query === 'function') { - return customQuery(db, fun, opts); + + // Get a listing of the documents in the database given + // by host and ordered by increasing id. + api.allDocs = adapterFun('allDocs', function (opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; } - if (pouchdbUtils.isRemote(db)) { - return httpQuery(db, fun, opts); + opts = pouchdbUtils.clone(opts); + + // List of parameters to add to the GET request + var params = {}; + var body; + var method = 'GET'; + + if (opts.conflicts) { + params.conflicts = true; } - - if (typeof fun !== 'string') { - // temp_view - checkQueryParseError(opts, fun); - tempViewQueue.add(function () { - var createViewPromise = createView( - /* sourceDB */ db, - /* viewName */ 'temp_view/temp_view', - /* mapFun */ fun.map, - /* reduceFun */ fun.reduce, - /* temporary */ true, - /* localDocName */ localDocName); - return createViewPromise.then(function (view) { - return pouchdbMapreduceUtils.fin(updateView(view).then(function () { - return queryView(view, opts); - }), function () { - return view.db.destroy(); - }); - }); - }); - return tempViewQueue.finish(); - } else { - // persistent view - var fullViewName = fun; - var parts = parseViewName(fullViewName); - var designDocName = parts[0]; - var viewName = parts[1]; - return db.get('_design/' + designDocName).then(function (doc) { - var fun = doc.views && doc.views[viewName]; + /* istanbul ignore if */ + if (opts.update_seq) { + params.update_seq = true; + } - if (!fun) { - // basic validator; it's assumed that every subclass would want this - throw new pouchdbMapreduceUtils.NotFoundError('ddoc ' + doc._id + ' has no view named ' + - viewName); - } + if (opts.descending) { + params.descending = true; + } - ddocValidator(doc, viewName); - checkQueryParseError(opts, fun); + if (opts.include_docs) { + params.include_docs = true; + } - var createViewPromise = createView( - /* sourceDB */ db, - /* viewName */ fullViewName, - /* mapFun */ fun.map, - /* reduceFun */ fun.reduce, - /* temporary */ false, - /* localDocName */ localDocName); - return createViewPromise.then(function (view) { - if (opts.stale === 'ok' || opts.stale === 'update_after') { - if (opts.stale === 'update_after') { - pouchdbUtils.nextTick(function () { - updateView(view); - }); - } - return queryView(view, opts); - } else { // stale not ok - return updateView(view).then(function () { - return queryView(view, opts); - }); - } - }); - }); + // added in CouchDB 1.6.0 + if (opts.attachments) { + params.attachments = true; } - } - function abstractQuery(fun, opts, callback) { - var db = this; - if (typeof opts === 'function') { - callback = opts; - opts = {}; + if (opts.key) { + params.key = JSON.stringify(opts.key); } - opts = opts ? coerceOptions(opts) : {}; - if (typeof fun === 'function') { - fun = {map : fun}; + if (opts.start_key) { + opts.startkey = opts.start_key; } - var promise = Promise.resolve().then(function () { - return queryPromised(db, fun, opts); - }); - pouchdbMapreduceUtils.promisedCallback(promise, callback); - return promise; - } + if (opts.startkey) { + params.startkey = JSON.stringify(opts.startkey); + } - var abstractViewCleanup = pouchdbMapreduceUtils.callbackify(function () { - var db = this; - /* istanbul ignore next */ - if (typeof db._viewCleanup === 'function') { - return customViewCleanup(db); + if (opts.end_key) { + opts.endkey = opts.end_key; } - if (pouchdbUtils.isRemote(db)) { - return httpViewCleanup(db); + + if (opts.endkey) { + params.endkey = JSON.stringify(opts.endkey); } - return localViewCleanup(db); - }); - return { - query: abstractQuery, - viewCleanup: abstractViewCleanup - }; -} + if (typeof opts.inclusive_end !== 'undefined') { + params.inclusive_end = !!opts.inclusive_end; + } -module.exports = createAbstractMapReduce; + if (typeof opts.limit !== 'undefined') { + params.limit = opts.limit; + } -},{"pouchdb-binary-utils":517,"pouchdb-collate":521,"pouchdb-collections":505,"pouchdb-mapreduce-utils":535,"pouchdb-md5":537,"pouchdb-promise":506,"pouchdb-utils":542}],505:[function(require,module,exports){ -'use strict'; + if (typeof opts.skip !== 'undefined') { + params.skip = opts.skip; + } -Object.defineProperty(exports, '__esModule', { value: true }); + var paramStr = paramsToStr(params); -function mangle(key) { - return '$' + key; -} -function unmangle(key) { - return key.substring(1); -} -function Map$1() { - this._store = {}; -} -Map$1.prototype.get = function (key) { - var mangled = mangle(key); - return this._store[mangled]; -}; -Map$1.prototype.set = function (key, value) { - var mangled = mangle(key); - this._store[mangled] = value; - return true; -}; -Map$1.prototype.has = function (key) { - var mangled = mangle(key); - return mangled in this._store; -}; -Map$1.prototype.delete = function (key) { - var mangled = mangle(key); - var res = mangled in this._store; - delete this._store[mangled]; - return res; -}; -Map$1.prototype.forEach = function (cb) { - var keys = Object.keys(this._store); - for (var i = 0, len = keys.length; i < len; i++) { - var key = keys[i]; - var value = this._store[key]; - key = unmangle(key); - cb(value, key); - } -}; -Object.defineProperty(Map$1.prototype, 'size', { - get: function () { - return Object.keys(this._store).length; - } -}); - -function Set$1(array) { - this._store = new Map$1(); - - // init with an array - if (array && Array.isArray(array)) { - for (var i = 0, len = array.length; i < len; i++) { - this.add(array[i]); + if (typeof opts.keys !== 'undefined') { + method = 'POST'; + body = {keys: opts.keys}; } - } -} -Set$1.prototype.add = function (key) { - return this._store.set(key, true); -}; -Set$1.prototype.has = function (key) { - return this._store.has(key); -}; -Set$1.prototype.forEach = function (cb) { - this._store.forEach(function (value, key) { - cb(key); + + // Get the document listing + ajaxPromise(opts, { + method: method, + url: genDBUrl(host, '_all_docs' + paramStr), + body: body + }).then(function (res) { + if (opts.include_docs && opts.attachments && opts.binary) { + res.rows.forEach(readAttachmentsAsBlobOrBuffer); + } + callback(null, res); + }).catch(callback); }); -}; -Object.defineProperty(Set$1.prototype, 'size', { - get: function () { - return this._store.size; - } -}); -/* global Map,Set,Symbol */ -// Based on https://kangax.github.io/compat-table/es6/ we can sniff out -// incomplete Map/Set implementations which would otherwise cause our tests to fail. -// Notably they fail in IE11 and iOS 8.4, which this prevents. -function supportsMapAndSet() { - if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') { - return false; - } - var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species); - return prop && 'get' in prop && Map[Symbol.species] === Map; -} + // Get a list of changes made to documents in the database given by host. + // TODO According to the README, there should be two other methods here, + // api.changes.addListener and api.changes.removeListener. + api._changes = function (opts) { -// based on https://github.com/montagejs/collections -/* global Map,Set */ + // We internally page the results of a changes request, this means + // if there is a large set of changes to be returned we can start + // processing them quicker instead of waiting on the entire + // set of changes to return and attempting to process them at once + var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE; -{ - if (supportsMapAndSet()) { // prefer built-in Map/Set - exports.Set = Set; - exports.Map = Map; - } else { // fall back to our polyfill - exports.Set = Set$1; - exports.Map = Map$1; - } -} + opts = pouchdbUtils.clone(opts); -},{}],506:[function(require,module,exports){ -'use strict'; + if (opts.continuous && !('heartbeat' in opts)) { + opts.heartbeat = DEFAULT_HEARTBEAT; + } -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + var requestTimeout = ('timeout' in opts) ? opts.timeout : + ('timeout' in ajaxOpts) ? ajaxOpts.timeout : + 30 * 1000; -var lie = _interopDefault(require('lie')); + // ensure CHANGES_TIMEOUT_BUFFER applies + if ('timeout' in opts && opts.timeout && + (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) { + requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER; + } -/* istanbul ignore next */ -var PouchPromise = typeof Promise === 'function' ? Promise : lie; + if ('heartbeat' in opts && opts.heartbeat && + (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) { + requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER; + } -module.exports = PouchPromise; + var params = {}; + if ('timeout' in opts && opts.timeout) { + params.timeout = opts.timeout; + } -},{"lie":500}],507:[function(require,module,exports){ -'use strict'; + var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false; + var returnDocs; + if ('return_docs' in opts) { + returnDocs = opts.return_docs; + } else if ('returnDocs' in opts) { + // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release + returnDocs = opts.returnDocs; + } else { + returnDocs = true; + } + // + var leftToFetch = limit; -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + if (opts.style) { + params.style = opts.style; + } -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbUtils = require('pouchdb-utils'); -var ajaxCore = _interopDefault(require('pouchdb-ajax')); -var getArguments = _interopDefault(require('argsarray')); -var pouchdbBinaryUtils = require('pouchdb-binary-utils'); -var pouchdbErrors = require('pouchdb-errors'); + if (opts.include_docs || opts.filter && typeof opts.filter === 'function') { + params.include_docs = true; + } -// dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool -// but much smaller in code size. limits the number of concurrent promises that are executed + if (opts.attachments) { + params.attachments = true; + } + if (opts.continuous) { + params.feed = 'longpoll'; + } -function pool(promiseFactories, limit) { - return new Promise(function (resolve, reject) { - var running = 0; - var current = 0; - var done = 0; - var len = promiseFactories.length; - var err; + if (opts.seq_interval) { + params.seq_interval = opts.seq_interval; + } - function runNext() { - running++; - promiseFactories[current++]().then(onSuccess, onError); + if (opts.conflicts) { + params.conflicts = true; } - function doNext() { - if (++done === len) { - /* istanbul ignore if */ - if (err) { - reject(err); - } else { - resolve(); - } - } else { - runNextBatch(); + if (opts.descending) { + params.descending = true; + } + + /* istanbul ignore if */ + if (opts.update_seq) { + params.update_seq = true; + } + + if ('heartbeat' in opts) { + // If the heartbeat value is false, it disables the default heartbeat + if (opts.heartbeat) { + params.heartbeat = opts.heartbeat; } } - function onSuccess() { - running--; - doNext(); + if (opts.filter && typeof opts.filter === 'string') { + params.filter = opts.filter; } - /* istanbul ignore next */ - function onError(thisErr) { - running--; - err = err || thisErr; - doNext(); + if (opts.view && typeof opts.view === 'string') { + params.filter = '_view'; + params.view = opts.view; } - function runNextBatch() { - while (running < limit && current < len) { - runNext(); + // If opts.query_params exists, pass it through to the changes request. + // These parameters may be used by the filter on the source database. + if (opts.query_params && typeof opts.query_params === 'object') { + for (var param_name in opts.query_params) { + /* istanbul ignore else */ + if (opts.query_params.hasOwnProperty(param_name)) { + params[param_name] = opts.query_params[param_name]; + } } } - runNextBatch(); - }); -} + var method = 'GET'; + var body; -var CHANGES_BATCH_SIZE = 25; -var MAX_SIMULTANEOUS_REVS = 50; -var CHANGES_TIMEOUT_BUFFER = 5000; -var DEFAULT_HEARTBEAT = 10000; + if (opts.doc_ids) { + // set this automagically for the user; it's annoying that couchdb + // requires both a "filter" and a "doc_ids" param. + params.filter = '_doc_ids'; + method = 'POST'; + body = {doc_ids: opts.doc_ids }; + } + /* istanbul ignore next */ + else if (opts.selector) { + // set this automagically for the user, similar to above + params.filter = '_selector'; + method = 'POST'; + body = {selector: opts.selector }; + } -var supportsBulkGetMap = {}; + var xhr; + var lastFetchedSeq; -function readAttachmentsAsBlobOrBuffer(row) { - var doc = row.doc || row.ok; - var atts = doc._attachments; - if (!atts) { - return; - } - Object.keys(atts).forEach(function (filename) { - var att = atts[filename]; - att.data = pouchdbBinaryUtils.base64StringToBlobOrBuffer(att.data, att.content_type); - }); -} + // Get all the changes starting wtih the one immediately after the + // sequence number given by since. + var fetch = function (since, callback) { + if (opts.aborted) { + return; + } + params.since = since; + // "since" can be any kind of json object in Coudant/CouchDB 2.x + /* istanbul ignore next */ + if (typeof params.since === "object") { + params.since = JSON.stringify(params.since); + } -function encodeDocId(id) { - if (/^_design/.test(id)) { - return '_design/' + encodeURIComponent(id.slice(8)); - } - if (/^_local/.test(id)) { - return '_local/' + encodeURIComponent(id.slice(7)); - } - return encodeURIComponent(id); -} + if (opts.descending) { + if (limit) { + params.limit = leftToFetch; + } + } else { + params.limit = (!limit || leftToFetch > batchSize) ? + batchSize : leftToFetch; + } -function preprocessAttachments(doc) { - if (!doc._attachments || !Object.keys(doc._attachments)) { - return Promise.resolve(); - } + // Set the options for the ajax call + var xhrOpts = { + method: method, + url: genDBUrl(host, '_changes' + paramsToStr(params)), + timeout: requestTimeout, + body: body + }; + lastFetchedSeq = since; - return Promise.all(Object.keys(doc._attachments).map(function (key) { - var attachment = doc._attachments[key]; - if (attachment.data && typeof attachment.data !== 'string') { - return new Promise(function (resolve) { - pouchdbBinaryUtils.blobOrBufferToBase64(attachment.data, resolve); - }).then(function (b64) { - attachment.data = b64; - }); - } - })); -} + /* istanbul ignore if */ + if (opts.aborted) { + return; + } -function hasUrlPrefix(opts) { - if (!opts.prefix) { - return false; - } + // Get the changes + setup().then(function () { + xhr = ajax(opts, xhrOpts, callback); + }).catch(callback); + }; - var protocol = pouchdbUtils.parseUri(opts.prefix).protocol; + // If opts.since exists, get all the changes from the sequence + // number given by opts.since. Otherwise, get all the changes + // from the sequence number 0. + var results = {results: []}; - return protocol === 'http' || protocol === 'https'; -} + var fetched = function (err, res) { + if (opts.aborted) { + return; + } + var raw_results_length = 0; + // If the result of the ajax call (res) contains changes (res.results) + if (res && res.results) { + raw_results_length = res.results.length; + results.last_seq = res.last_seq; + var pending = null; + var lastSeq = null; + // Attach 'pending' property if server supports it (CouchDB 2.0+) + /* istanbul ignore if */ + if (typeof res.pending === 'number') { + pending = res.pending; + } + if (typeof results.last_seq === 'string' || typeof results.last_seq === 'number') { + lastSeq = results.last_seq; + } + // For each change + var req = {}; + req.query = opts.query_params; + res.results = res.results.filter(function (c) { + leftToFetch--; + var ret = pouchdbUtils.filterChange(opts)(c); + if (ret) { + if (opts.include_docs && opts.attachments && opts.binary) { + readAttachmentsAsBlobOrBuffer(c); + } + if (returnDocs) { + results.results.push(c); + } + opts.onChange(c, pending, lastSeq); + } + return ret; + }); + } else if (err) { + // In case of an error, stop listening for changes and call + // opts.complete + opts.aborted = true; + opts.complete(err); + return; + } -// Get all the information you possibly can about the URI given by name and -// return it as a suitable object. -function getHost(name, opts) { + // The changes feed may have timed out with no results + // if so reuse last update sequence + if (res && res.last_seq) { + lastFetchedSeq = res.last_seq; + } - // encode db name if opts.prefix is a url (#5574) - if (hasUrlPrefix(opts)) { - var dbName = opts.name.substr(opts.prefix.length); - name = opts.prefix + encodeURIComponent(dbName); - } + var finished = (limit && leftToFetch <= 0) || + (res && raw_results_length < batchSize) || + (opts.descending); - // Prase the URI into all its little bits - var uri = pouchdbUtils.parseUri(name); + if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) { + // Queue a call to fetch again with the newest sequence number + pouchdbUtils.nextTick(function () { fetch(lastFetchedSeq, fetched); }); + } else { + // We're done, call the callback + opts.complete(null, results); + } + }; - // Store the user and password as a separate auth object - if (uri.user || uri.password) { - uri.auth = {username: uri.user, password: uri.password}; - } + fetch(opts.since || 0, fetched); - // Split the path part of the URI into parts using '/' as the delimiter - // after removing any leading '/' and any trailing '/' - var parts = uri.path.replace(/(^\/|\/$)/g, '').split('/'); + // Return a method to cancel this method from processing any more + return { + cancel: function () { + opts.aborted = true; + if (xhr) { + xhr.abort(); + } + } + }; + }; - // Store the first part as the database name and remove it from the parts - // array - uri.db = parts.pop(); - // Prevent double encoding of URI component - if (uri.db.indexOf('%') === -1) { - uri.db = encodeURIComponent(uri.db); - } + // Given a set of document/revision IDs (given by req), tets the subset of + // those that do NOT correspond to revisions stored in the database. + // See http://wiki.apache.org/couchdb/HttpPostRevsDiff + api.revsDiff = adapterFun('revsDiff', function (req, opts, callback) { + // If no options were given, set the callback to be the second parameter + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } - // Restore the path by joining all the remaining parts (all the parts - // except for the database name) with '/'s - uri.path = parts.join('/'); + // Get the missing document/revision IDs + ajax(opts, { + method: 'POST', + url: genDBUrl(host, '_revs_diff'), + body: req + }, callback); + }); - return uri; -} + api._close = function (callback) { + callback(); + }; -// Generate a URL with the host data given by opts and the given path -function genDBUrl(opts, path) { - return genUrl(opts, opts.db + '/' + path); + api._destroy = function (options, callback) { + ajax(options, { + url: genDBUrl(host, ''), + method: 'DELETE' + }, function (err, resp) { + if (err && err.status && err.status !== 404) { + return callback(err); + } + callback(null, resp); + }); + }; } -// Generate a URL with the host data given by opts and the given path -function genUrl(opts, path) { - // If the host already has a path, then we need to have a path delimiter - // Otherwise, the path delimiter is the empty string - var pathDel = !opts.path ? '' : '/'; +// HttpPouch is a valid adapter. +HttpPouch.valid = function () { + return true; +}; - // If the host already has a path, then we need to have a path delimiter - // Otherwise, the path delimiter is the empty string - return opts.protocol + '://' + opts.host + - (opts.port ? (':' + opts.port) : '') + - '/' + opts.path + pathDel + path; +function index (PouchDB) { + PouchDB.adapter('http', HttpPouch, false); + PouchDB.adapter('https', HttpPouch, false); } -function paramsToStr(params) { - return '?' + Object.keys(params).map(function (k) { - return k + '=' + encodeURIComponent(params[k]); - }).join('&'); -} +module.exports = index; -// Implements the PouchDB API for dealing with CouchDB instances over HTTP -function HttpPouch(opts, callback) { +},{"argsarray":39,"pouchdb-ajax":506,"pouchdb-binary-utils":507,"pouchdb-errors":509,"pouchdb-promise":510,"pouchdb-utils":511}],505:[function(require,module,exports){ +arguments[4][501][0].apply(exports,arguments) +},{"dup":501}],506:[function(require,module,exports){ +'use strict'; - // The functions that will be publicly available for HttpPouch - var api = this; +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - var host = getHost(opts.name, opts); - var dbUrl = genDBUrl(host, ''); +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbErrors = require('pouchdb-errors'); - opts = pouchdbUtils.clone(opts); - var ajaxOpts = opts.ajax || {}; +/* global fetch */ +/* global Headers */ +function wrappedFetch() { + var wrappedPromise = {}; - if (opts.auth || host.auth) { - var nAuth = opts.auth || host.auth; - var str = nAuth.username + ':' + nAuth.password; - var token = pouchdbBinaryUtils.btoa(unescape(encodeURIComponent(str))); - ajaxOpts.headers = ajaxOpts.headers || {}; - ajaxOpts.headers.Authorization = 'Basic ' + token; - } + var promise = new Promise(function (resolve, reject) { + wrappedPromise.resolve = resolve; + wrappedPromise.reject = reject; + }); - // Not strictly necessary, but we do this because numerous tests - // rely on swapping ajax in and out. - api._ajax = ajaxCore; + var args = new Array(arguments.length); - function ajax(userOpts, options, callback) { - var reqAjax = (userOpts || {}).ajax || {}; - var reqOpts = pouchdbUtils.assign(pouchdbUtils.clone(ajaxOpts), reqAjax, options); - var defaultHeaders = pouchdbUtils.clone(ajaxOpts.headers || {}); - reqOpts.headers = pouchdbUtils.assign(defaultHeaders, reqAjax.headers, - options.headers || {}); - /* istanbul ignore if */ - if (api.constructor.listeners('debug').length) { - api.constructor.emit('debug', ['http', reqOpts.method, reqOpts.url]); - } - return api._ajax(reqOpts, callback); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; } - function ajaxPromise(userOpts, opts) { - return new Promise(function (resolve, reject) { - ajax(userOpts, opts, function (err, res) { - /* istanbul ignore if */ - if (err) { - return reject(err); - } - resolve(res); - }); - }); - } + wrappedPromise.promise = promise; - function adapterFun$$1(name, fun) { - return pouchdbUtils.adapterFun(name, getArguments(function (args) { - setup().then(function () { - return fun.apply(this, args); - }).catch(function (e) { - var callback = args.pop(); - callback(e); - }); - })); - } + Promise.resolve().then(function () { + return fetch.apply(null, args); + }).then(function (response) { + wrappedPromise.resolve(response); + }).catch(function (error) { + wrappedPromise.reject(error); + }); - var setupPromise; + return wrappedPromise; +} - function setup() { - // TODO: Remove `skipSetup` in favor of `skip_setup` in a future release - if (opts.skipSetup || opts.skip_setup) { - return Promise.resolve(); - } +function fetchRequest(options, callback) { + var wrappedPromise, timer, response; - // If there is a setup in process or previous successful setup - // done then we will use that - // If previous setups have been rejected we will try again - if (setupPromise) { - return setupPromise; - } + var headers = new Headers(); - var checkExists = {method: 'GET', url: dbUrl}; - setupPromise = ajaxPromise({}, checkExists).catch(function (err) { - if (err && err.status && err.status === 404) { - // Doesnt exist, create it - pouchdbUtils.explainError(404, 'PouchDB is just detecting if the remote exists.'); - return ajaxPromise({}, {method: 'PUT', url: dbUrl}); - } else { - return Promise.reject(err); - } - }).catch(function (err) { - // If we try to create a database that already exists, skipped in - // istanbul since its catching a race condition. - /* istanbul ignore if */ - if (err && err.status && err.status === 412) { - return true; - } - return Promise.reject(err); - }); + var fetchOptions = { + method: options.method, + credentials: 'include', + headers: headers + }; - setupPromise.catch(function () { - setupPromise = null; - }); + if (options.json) { + headers.set('Accept', 'application/json'); + headers.set('Content-Type', options.headers['Content-Type'] || + 'application/json'); + } - return setupPromise; + if (options.body && + options.processData && + typeof options.body !== 'string') { + fetchOptions.body = JSON.stringify(options.body); + } else if ('body' in options) { + fetchOptions.body = options.body; + } else { + fetchOptions.body = null; } - pouchdbUtils.nextTick(function () { - callback(null, api); + Object.keys(options.headers).forEach(function (key) { + if (options.headers.hasOwnProperty(key)) { + headers.set(key, options.headers[key]); + } }); - api._remote = true; - /* istanbul ignore next */ - api.type = function () { - return 'http'; - }; + wrappedPromise = wrappedFetch(options.url, fetchOptions); - api.id = adapterFun$$1('id', function (callback) { - ajax({}, {method: 'GET', url: genUrl(host, '')}, function (err, result) { - var uuid = (result && result.uuid) ? - (result.uuid + host.db) : genDBUrl(host, ''); - callback(null, uuid); - }); - }); + if (options.timeout > 0) { + timer = setTimeout(function () { + wrappedPromise.reject(new Error('Load timeout for resource: ' + + options.url)); + }, options.timeout); + } - api.request = adapterFun$$1('request', function (options, callback) { - options.url = genDBUrl(host, options.url); - ajax({}, options, callback); - }); + wrappedPromise.promise.then(function (fetchResponse) { + response = { + statusCode: fetchResponse.status + }; - // Sends a POST request to the host calling the couchdb _compact function - // version: The version of CouchDB it is running - api.compact = adapterFun$$1('compact', function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; + if (options.timeout > 0) { + clearTimeout(timer); } - opts = pouchdbUtils.clone(opts); - ajax(opts, { - url: genDBUrl(host, '_compact'), - method: 'POST' - }, function () { - function ping() { - api.info(function (err, res) { - // CouchDB may send a "compact_running:true" if it's - // already compacting. PouchDB Server doesn't. - /* istanbul ignore else */ - if (res && !res.compact_running) { - callback(null, {ok: true}); - } else { - setTimeout(ping, opts.interval || 200); - } - }); - } - // Ping the http if it's finished compaction - ping(); - }); - }); - api.bulkGet = pouchdbUtils.adapterFun('bulkGet', function (opts, callback) { - var self = this; - - function doBulkGet(cb) { - var params = {}; - if (opts.revs) { - params.revs = true; - } - if (opts.attachments) { - /* istanbul ignore next */ - params.attachments = true; - } - if (opts.latest) { - params.latest = true; - } - ajax(opts, { - url: genDBUrl(host, '_bulk_get' + paramsToStr(params)), - method: 'POST', - body: { docs: opts.docs} - }, function (err, result) { - if (!err && opts.attachments && opts.binary) { - result.results.forEach(function (res) { - res.docs.forEach(readAttachmentsAsBlobOrBuffer); - }); - } - cb(err, result); - }); + if (response.statusCode >= 200 && response.statusCode < 300) { + return options.binary ? fetchResponse.blob() : fetchResponse.text(); } - /* istanbul ignore next */ - function doBulkGetShim() { - // avoid "url too long error" by splitting up into multiple requests - var batchSize = MAX_SIMULTANEOUS_REVS; - var numBatches = Math.ceil(opts.docs.length / batchSize); - var numDone = 0; - var results = new Array(numBatches); + return fetchResponse.json(); + }).then(function (result) { + if (response.statusCode >= 200 && response.statusCode < 300) { + callback(null, response, result); + } else { + result.status = response.statusCode; + callback(result); + } + }).catch(function (error) { + if (!error) { + // this happens when the listener is canceled + error = new Error('canceled'); + } + callback(error); + }); - function onResult(batchNum) { - return function (err, res) { - // err is impossible because shim returns a list of errs in that case - results[batchNum] = res.results; - if (++numDone === numBatches) { - callback(null, {results: pouchdbUtils.flatten(results)}); - } - }; - } + return {abort: wrappedPromise.reject}; +} - for (var i = 0; i < numBatches; i++) { - var subOpts = pouchdbUtils.pick(opts, ['revs', 'attachments', 'binary', 'latest']); - subOpts.ajax = ajaxOpts; - subOpts.docs = opts.docs.slice(i * batchSize, - Math.min(opts.docs.length, (i + 1) * batchSize)); - pouchdbUtils.bulkGetShim(self, subOpts, onResult(i)); - } - } +function xhRequest(options, callback) { - // mark the whole database as either supporting or not supporting _bulk_get - var dbUrl = genUrl(host, ''); - var supportsBulkGet = supportsBulkGetMap[dbUrl]; + var xhr, timer; + var timedout = false; - /* istanbul ignore next */ - if (typeof supportsBulkGet !== 'boolean') { - // check if this database supports _bulk_get - doBulkGet(function (err, res) { - if (err) { - supportsBulkGetMap[dbUrl] = false; - pouchdbUtils.explainError( - err.status, - 'PouchDB is just detecting if the remote ' + - 'supports the _bulk_get API.' - ); - doBulkGetShim(); - } else { - supportsBulkGetMap[dbUrl] = true; - callback(null, res); - } - }); - } else if (supportsBulkGet) { - doBulkGet(callback); - } else { - doBulkGetShim(); - } - }); + var abortReq = function () { + xhr.abort(); + cleanUp(); + }; - // Calls GET on the host, which gets back a JSON string containing - // couchdb: A welcome string - // version: The version of CouchDB it is running - api._info = function (callback) { - setup().then(function () { - ajax({}, { - method: 'GET', - url: genDBUrl(host, '') - }, function (err, res) { - /* istanbul ignore next */ - if (err) { - return callback(err); - } - res.host = genDBUrl(host, ''); - callback(null, res); - }); - }).catch(callback); + var timeoutReq = function () { + timedout = true; + xhr.abort(); + cleanUp(); }; - // Get the document with the given id from the database given by host. - // The id could be solely the _id in the database, or it may be a - // _design/ID or _local/ID path - api.get = adapterFun$$1('get', function (id, opts, callback) { - // If no options were given, set the callback to the second parameter - if (typeof opts === 'function') { - callback = opts; - opts = {}; + var ret = {abort: abortReq}; + + var cleanUp = function () { + clearTimeout(timer); + ret.abort = function () {}; + if (xhr) { + xhr.onprogress = undefined; + if (xhr.upload) { + xhr.upload.onprogress = undefined; + } + xhr.onreadystatechange = undefined; + xhr = undefined; } - opts = pouchdbUtils.clone(opts); + }; - // List of parameters to add to the GET request - var params = {}; + if (options.xhr) { + xhr = new options.xhr(); + } else { + xhr = new XMLHttpRequest(); + } - if (opts.revs) { - params.revs = true; - } + try { + xhr.open(options.method, options.url); + } catch (exception) { + return callback(new Error(exception.name || 'Url is invalid')); + } - if (opts.revs_info) { - params.revs_info = true; - } + xhr.withCredentials = ('withCredentials' in options) ? + options.withCredentials : true; - if (opts.latest) { - params.latest = true; + if (options.method === 'GET') { + delete options.headers['Content-Type']; + } else if (options.json) { + options.headers.Accept = 'application/json'; + options.headers['Content-Type'] = options.headers['Content-Type'] || + 'application/json'; + if (options.body && + options.processData && + typeof options.body !== "string") { + options.body = JSON.stringify(options.body); } + } - if (opts.open_revs) { - if (opts.open_revs !== "all") { - opts.open_revs = JSON.stringify(opts.open_revs); - } - params.open_revs = opts.open_revs; - } + if (options.binary) { + xhr.responseType = 'arraybuffer'; + } - if (opts.rev) { - params.rev = opts.rev; - } + if (!('body' in options)) { + options.body = null; + } - if (opts.conflicts) { - params.conflicts = opts.conflicts; + for (var key in options.headers) { + if (options.headers.hasOwnProperty(key)) { + xhr.setRequestHeader(key, options.headers[key]); } + } - /* istanbul ignore if */ - if (opts.update_seq) { - params.update_seq = opts.update_seq; + if (options.timeout > 0) { + timer = setTimeout(timeoutReq, options.timeout); + xhr.onprogress = function () { + clearTimeout(timer); + if (xhr.readyState !== 4) { + timer = setTimeout(timeoutReq, options.timeout); + } + }; + if (typeof xhr.upload !== 'undefined') { // does not exist in ie9 + xhr.upload.onprogress = xhr.onprogress; } + } - id = encodeDocId(id); + xhr.onreadystatechange = function () { + if (xhr.readyState !== 4) { + return; + } - // Set the options for the ajax call - var options = { - method: 'GET', - url: genDBUrl(host, id + paramsToStr(params)) + var response = { + statusCode: xhr.status }; - function fetchAttachments(doc) { - var atts = doc._attachments; - var filenames = atts && Object.keys(atts); - if (!atts || !filenames.length) { - return; - } - // we fetch these manually in separate XHRs, because - // Sync Gateway would normally send it back as multipart/mixed, - // which we cannot parse. Also, this is more efficient than - // receiving attachments as base64-encoded strings. - function fetch(filename) { - var att = atts[filename]; - var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) + - '?rev=' + doc._rev; - return ajaxPromise(opts, { - method: 'GET', - url: genDBUrl(host, path), - binary: true - }).then(function (blob) { - if (opts.binary) { - return blob; - } - return new Promise(function (resolve) { - pouchdbBinaryUtils.blobOrBufferToBase64(blob, resolve); - }); - }).then(function (data) { - delete att.stub; - delete att.length; - att.data = data; + if (xhr.status >= 200 && xhr.status < 300) { + var data; + if (options.binary) { + data = pouchdbBinaryUtils.blob([xhr.response || ''], { + type: xhr.getResponseHeader('Content-Type') }); + } else { + data = xhr.responseText; + } + callback(null, response, data); + } else { + var err = {}; + if (timedout) { + err = new Error('ETIMEDOUT'); + err.code = 'ETIMEDOUT'; + } else if (typeof xhr.response === 'string' && xhr.response !== '') { + try { + err = JSON.parse(xhr.response); + } catch (e) {} } - var promiseFactories = filenames.map(function (filename) { - return function () { - return fetch(filename); - }; - }); - - // This limits the number of parallel xhr requests to 5 any time - // to avoid issues with maximum browser request limits - return pool(promiseFactories, 5); - } + err.status = xhr.status; - function fetchAllAttachments(docOrDocs) { - if (Array.isArray(docOrDocs)) { - return Promise.all(docOrDocs.map(function (doc) { - if (doc.ok) { - return fetchAttachments(doc.ok); - } - })); - } - return fetchAttachments(docOrDocs); + callback(err); } + cleanUp(); + }; - ajaxPromise(opts, options).then(function (res) { - return Promise.resolve().then(function () { - if (opts.attachments) { - return fetchAllAttachments(res); - } - }).then(function () { - callback(null, res); - }); - }).catch(function (e) { - e.docId = id; - callback(e); + if (options.body && (options.body instanceof Blob)) { + pouchdbBinaryUtils.readAsArrayBuffer(options.body, function (arrayBuffer) { + xhr.send(arrayBuffer); }); - }); - - // Delete the document given by doc from the database given by host. - api.remove = adapterFun$$1('remove', - function (docOrId, optsOrRev, opts, callback) { - var doc; - if (typeof optsOrRev === 'string') { - // id, rev, opts, callback style - doc = { - _id: docOrId, - _rev: optsOrRev - }; - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - } else { - // doc, opts, callback style - doc = docOrId; - if (typeof optsOrRev === 'function') { - callback = optsOrRev; - opts = {}; - } else { - callback = opts; - opts = optsOrRev; - } - } + } else { + xhr.send(options.body); + } - var rev = (doc._rev || opts.rev); + return ret; +} - // Delete the document - ajax(opts, { - method: 'DELETE', - url: genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev - }, callback); - }); - - function encodeAttachmentId(attachmentId) { - return attachmentId.split("/").map(encodeURIComponent).join("/"); +function testXhr() { + try { + new XMLHttpRequest(); + return true; + } catch (err) { + return false; } +} - // Get the attachment - api.getAttachment = - adapterFun$$1('getAttachment', function (docId, attachmentId, opts, - callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - var params = opts.rev ? ('?rev=' + opts.rev) : ''; - var url = genDBUrl(host, encodeDocId(docId)) + '/' + - encodeAttachmentId(attachmentId) + params; - ajax(opts, { - method: 'GET', - url: url, - binary: true - }, callback); - }); - - // Remove the attachment given by the id and rev - api.removeAttachment = - adapterFun$$1('removeAttachment', function (docId, attachmentId, rev, - callback) { - - var url = genDBUrl(host, encodeDocId(docId) + '/' + - encodeAttachmentId(attachmentId)) + '?rev=' + rev; +var hasXhr = testXhr(); - ajax({}, { - method: 'DELETE', - url: url - }, callback); - }); +function ajax(options, callback) { + if (!false && (hasXhr || options.xhr)) { + return xhRequest(options, callback); + } else { + return fetchRequest(options, callback); + } +} - // Add the attachment given by blob and its contentType property - // to the document with the given id, the revision given by rev, and - // add it to the database given by host. - api.putAttachment = - adapterFun$$1('putAttachment', function (docId, attachmentId, rev, blob, - type, callback) { - if (typeof type === 'function') { - callback = type; - type = blob; - blob = rev; - rev = null; - } - var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId); - var url = genDBUrl(host, id); - if (rev) { - url += '?rev=' + rev; - } +// the blob already has a type; do nothing - if (typeof blob === 'string') { - // input is assumed to be a base64 string - var binary; - try { - binary = pouchdbBinaryUtils.atob(blob); - } catch (err) { - return callback(pouchdbErrors.createError(pouchdbErrors.BAD_ARG, - 'Attachment is not a valid base64 string')); - } - blob = binary ? pouchdbBinaryUtils.binaryStringToBlobOrBuffer(binary, type) : ''; - } +function defaultBody() { + return ''; +} - var opts = { - headers: {'Content-Type': type}, - method: 'PUT', - url: url, - processData: false, - body: blob, - timeout: ajaxOpts.timeout || 60000 - }; - // Add the attachment - ajax({}, opts, callback); - }); +function ajaxCore(options, callback) { - // Update/create multiple documents given by req in the database - // given by host. - api._bulkDocs = function (req, opts, callback) { - // If new_edits=false then it prevents the database from creating - // new revision numbers for the documents. Instead it just uses - // the old ones. This is used in database replication. - req.new_edits = opts.new_edits; + options = pouchdbUtils.clone(options); - setup().then(function () { - return Promise.all(req.docs.map(preprocessAttachments)); - }).then(function () { - // Update/create the documents - ajax(opts, { - method: 'POST', - url: genDBUrl(host, '_bulk_docs'), - timeout: opts.timeout, - body: req - }, function (err, results) { - if (err) { - return callback(err); - } - results.forEach(function (result) { - result.ok = true; // smooths out cloudant not adding this - }); - callback(null, results); - }); - }).catch(callback); + var defaultOptions = { + method : "GET", + headers: {}, + json: true, + processData: true, + timeout: 10000, + cache: false }; + options = pouchdbUtils.assign(defaultOptions, options); - // Update/create document - api._put = function (doc, opts, callback) { - setup().then(function () { - return preprocessAttachments(doc); - }).then(function () { - // Update/create the document - ajax(opts, { - method: 'PUT', - url: genDBUrl(host, encodeDocId(doc._id)), - body: doc - }, function (err, result) { - if (err) { - err.docId = doc && doc._id; - return callback(err); + function onSuccess(obj, resp, cb) { + if (!options.binary && options.json && typeof obj === 'string') { + /* istanbul ignore next */ + try { + obj = JSON.parse(obj); + } catch (e) { + // Probably a malformed JSON from server + return cb(e); + } + } + if (Array.isArray(obj)) { + obj = obj.map(function (v) { + if (v.error || v.missing) { + return pouchdbErrors.generateErrorFromResponse(v); + } else { + return v; } - callback(null, result); }); - }).catch(callback); - }; - - - // Get a listing of the documents in the database given - // by host and ordered by increasing id. - api.allDocs = adapterFun$$1('allDocs', function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; } - opts = pouchdbUtils.clone(opts); - - // List of parameters to add to the GET request - var params = {}; - var body; - var method = 'GET'; - - if (opts.conflicts) { - params.conflicts = true; + if (options.binary) { + } + cb(null, obj, resp); + } - /* istanbul ignore if */ - if (opts.update_seq) { - params.update_seq = true; + if (options.json) { + if (!options.binary) { + options.headers.Accept = 'application/json'; } + options.headers['Content-Type'] = options.headers['Content-Type'] || + 'application/json'; + } - if (opts.descending) { - params.descending = true; - } + if (options.binary) { + options.encoding = null; + options.json = false; + } - if (opts.include_docs) { - params.include_docs = true; - } + if (!options.processData) { + options.json = false; + } - // added in CouchDB 1.6.0 - if (opts.attachments) { - params.attachments = true; - } + return ajax(options, function (err, response, body) { - if (opts.key) { - params.key = JSON.stringify(opts.key); + if (err) { + return callback(pouchdbErrors.generateErrorFromResponse(err)); } - if (opts.start_key) { - opts.startkey = opts.start_key; - } + var error; + var content_type = response.headers && response.headers['content-type']; + var data = body || defaultBody(); - if (opts.startkey) { - params.startkey = JSON.stringify(opts.startkey); + // CouchDB doesn't always return the right content-type for JSON data, so + // we check for ^{ and }$ (ignoring leading/trailing whitespace) + if (!options.binary && (options.json || !options.processData) && + typeof data !== 'object' && + (/json/.test(content_type) || + (/^[\s]*\{/.test(data) && /\}[\s]*$/.test(data)))) { + try { + data = JSON.parse(data.toString()); + } catch (e) {} } - if (opts.end_key) { - opts.endkey = opts.end_key; + if (response.statusCode >= 200 && response.statusCode < 300) { + onSuccess(data, response, callback); + } else { + error = pouchdbErrors.generateErrorFromResponse(data); + error.status = response.statusCode; + callback(error); } + }); +} - if (opts.endkey) { - params.endkey = JSON.stringify(opts.endkey); - } +function ajax$1(opts, callback) { - if (typeof opts.inclusive_end !== 'undefined') { - params.inclusive_end = !!opts.inclusive_end; - } + // cache-buster, specifically designed to work around IE's aggressive caching + // see http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/ + // Also Safari caches POSTs, so we need to cache-bust those too. + var ua = (navigator && navigator.userAgent) ? + navigator.userAgent.toLowerCase() : ''; - if (typeof opts.limit !== 'undefined') { - params.limit = opts.limit; - } + var isSafari = ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1; + var isIE = ua.indexOf('msie') !== -1; + var isTrident = ua.indexOf('trident') !== -1; + var isEdge = ua.indexOf('edge') !== -1; - if (typeof opts.skip !== 'undefined') { - params.skip = opts.skip; - } + // it appears the new version of safari also caches GETs, + // see https://github.com/pouchdb/pouchdb/issues/5010 + var shouldCacheBust = (isSafari || + ((isIE || isTrident || isEdge) && opts.method === 'GET')); - var paramStr = paramsToStr(params); + var cache = 'cache' in opts ? opts.cache : true; - if (typeof opts.keys !== 'undefined') { - method = 'POST'; - body = {keys: opts.keys}; - } + var isBlobUrl = /^blob:/.test(opts.url); // don't append nonces for blob URLs - // Get the document listing - ajaxPromise(opts, { - method: method, - url: genDBUrl(host, '_all_docs' + paramStr), - body: body - }).then(function (res) { - if (opts.include_docs && opts.attachments && opts.binary) { - res.rows.forEach(readAttachmentsAsBlobOrBuffer); - } - callback(null, res); - }).catch(callback); - }); + if (!isBlobUrl && (shouldCacheBust || !cache)) { + var hasArgs = opts.url.indexOf('?') !== -1; + opts.url += (hasArgs ? '&' : '?') + '_nonce=' + Date.now(); + } - // Get a list of changes made to documents in the database given by host. - // TODO According to the README, there should be two other methods here, - // api.changes.addListener and api.changes.removeListener. - api._changes = function (opts) { + return ajaxCore(opts, callback); +} - // We internally page the results of a changes request, this means - // if there is a large set of changes to be returned we can start - // processing them quicker instead of waiting on the entire - // set of changes to return and attempting to process them at once - var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE; +module.exports = ajax$1; - opts = pouchdbUtils.clone(opts); +},{"pouchdb-binary-utils":507,"pouchdb-errors":509,"pouchdb-promise":510,"pouchdb-utils":511}],507:[function(require,module,exports){ +'use strict'; - if (opts.continuous && !('heartbeat' in opts)) { - opts.heartbeat = DEFAULT_HEARTBEAT; - } +Object.defineProperty(exports, '__esModule', { value: true }); - var requestTimeout = ('timeout' in opts) ? opts.timeout : - ('timeout' in ajaxOpts) ? ajaxOpts.timeout : - 30 * 1000; +var thisAtob = function (str) { + return atob(str); +}; - // ensure CHANGES_TIMEOUT_BUFFER applies - if ('timeout' in opts && opts.timeout && - (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) { - requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER; - } +var thisBtoa = function (str) { + return btoa(str); +}; - if ('heartbeat' in opts && opts.heartbeat && - (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) { - requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER; +// Abstracts constructing a Blob object, so it also works in older +// browsers that don't support the native Blob constructor (e.g. +// old QtWebKit versions, Android < 4.4). +function createBlob(parts, properties) { + /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ + parts = parts || []; + properties = properties || {}; + try { + return new Blob(parts, properties); + } catch (e) { + if (e.name !== "TypeError") { + throw e; } - - var params = {}; - if ('timeout' in opts && opts.timeout) { - params.timeout = opts.timeout; + var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : + typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : + typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : + WebKitBlobBuilder; + var builder = new Builder(); + for (var i = 0; i < parts.length; i += 1) { + builder.append(parts[i]); } + return builder.getBlob(properties.type); + } +} - var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false; - var returnDocs; - if ('return_docs' in opts) { - returnDocs = opts.return_docs; - } else if ('returnDocs' in opts) { - // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release - returnDocs = opts.returnDocs; - } else { - returnDocs = true; - } - // - var leftToFetch = limit; +// From http://stackoverflow.com/questions/14967647/ (continues on next line) +// encode-decode-image-with-base64-breaks-image (2013-04-21) +function binaryStringToArrayBuffer(bin) { + var length = bin.length; + var buf = new ArrayBuffer(length); + var arr = new Uint8Array(buf); + for (var i = 0; i < length; i++) { + arr[i] = bin.charCodeAt(i); + } + return buf; +} - if (opts.style) { - params.style = opts.style; - } +function binStringToBluffer(binString, type) { + return createBlob([binaryStringToArrayBuffer(binString)], {type: type}); +} - if (opts.include_docs || opts.filter && typeof opts.filter === 'function') { - params.include_docs = true; - } +function b64ToBluffer(b64, type) { + return binStringToBluffer(thisAtob(b64), type); +} - if (opts.attachments) { - params.attachments = true; - } +//Can't find original post, but this is close +//http://stackoverflow.com/questions/6965107/ (continues on next line) +//converting-between-strings-and-arraybuffers +function arrayBufferToBinaryString(buffer) { + var binary = ''; + var bytes = new Uint8Array(buffer); + var length = bytes.byteLength; + for (var i = 0; i < length; i++) { + binary += String.fromCharCode(bytes[i]); + } + return binary; +} - if (opts.continuous) { - params.feed = 'longpoll'; - } +// shim for browsers that don't support it +function readAsBinaryString(blob, callback) { + if (typeof FileReader === 'undefined') { + // fix for Firefox in a web worker + // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 + return callback(arrayBufferToBinaryString( + new FileReaderSync().readAsArrayBuffer(blob))); + } - if (opts.seq_interval) { - params.seq_interval = opts.seq_interval; + var reader = new FileReader(); + var hasBinaryString = typeof reader.readAsBinaryString === 'function'; + reader.onloadend = function (e) { + var result = e.target.result || ''; + if (hasBinaryString) { + return callback(result); } + callback(arrayBufferToBinaryString(result)); + }; + if (hasBinaryString) { + reader.readAsBinaryString(blob); + } else { + reader.readAsArrayBuffer(blob); + } +} - if (opts.conflicts) { - params.conflicts = true; - } +function blobToBinaryString(blobOrBuffer, callback) { + readAsBinaryString(blobOrBuffer, function (bin) { + callback(bin); + }); +} - if (opts.descending) { - params.descending = true; - } - - /* istanbul ignore if */ - if (opts.update_seq) { - params.update_seq = true; - } +function blobToBase64(blobOrBuffer, callback) { + blobToBinaryString(blobOrBuffer, function (base64) { + callback(thisBtoa(base64)); + }); +} - if ('heartbeat' in opts) { - // If the heartbeat value is false, it disables the default heartbeat - if (opts.heartbeat) { - params.heartbeat = opts.heartbeat; - } - } +// simplified API. universal browser support is assumed +function readAsArrayBuffer(blob, callback) { + if (typeof FileReader === 'undefined') { + // fix for Firefox in a web worker: + // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 + return callback(new FileReaderSync().readAsArrayBuffer(blob)); + } - if (opts.filter && typeof opts.filter === 'string') { - params.filter = opts.filter; - } + var reader = new FileReader(); + reader.onloadend = function (e) { + var result = e.target.result || new ArrayBuffer(0); + callback(result); + }; + reader.readAsArrayBuffer(blob); +} - if (opts.view && typeof opts.view === 'string') { - params.filter = '_view'; - params.view = opts.view; - } +// this is not used in the browser +function typedBuffer() { +} - // If opts.query_params exists, pass it through to the changes request. - // These parameters may be used by the filter on the source database. - if (opts.query_params && typeof opts.query_params === 'object') { - for (var param_name in opts.query_params) { - /* istanbul ignore else */ - if (opts.query_params.hasOwnProperty(param_name)) { - params[param_name] = opts.query_params[param_name]; - } - } - } +exports.atob = thisAtob; +exports.btoa = thisBtoa; +exports.base64StringToBlobOrBuffer = b64ToBluffer; +exports.binaryStringToArrayBuffer = binaryStringToArrayBuffer; +exports.binaryStringToBlobOrBuffer = binStringToBluffer; +exports.blob = createBlob; +exports.blobOrBufferToBase64 = blobToBase64; +exports.blobOrBufferToBinaryString = blobToBinaryString; +exports.readAsArrayBuffer = readAsArrayBuffer; +exports.readAsBinaryString = readAsBinaryString; +exports.typedBuffer = typedBuffer; - var method = 'GET'; - var body; +},{}],508:[function(require,module,exports){ +'use strict'; - if (opts.doc_ids) { - // set this automagically for the user; it's annoying that couchdb - // requires both a "filter" and a "doc_ids" param. - params.filter = '_doc_ids'; - method = 'POST'; - body = {doc_ids: opts.doc_ids }; - } - /* istanbul ignore next */ - else if (opts.selector) { - // set this automagically for the user, similar to above - params.filter = '_selector'; - method = 'POST'; - body = {selector: opts.selector }; - } - - var xhr; - var lastFetchedSeq; - - // Get all the changes starting wtih the one immediately after the - // sequence number given by since. - var fetch = function (since, callback) { - if (opts.aborted) { - return; - } - params.since = since; - // "since" can be any kind of json object in Coudant/CouchDB 2.x - /* istanbul ignore next */ - if (typeof params.since === "object") { - params.since = JSON.stringify(params.since); - } +Object.defineProperty(exports, '__esModule', { value: true }); - if (opts.descending) { - if (limit) { - params.limit = leftToFetch; - } - } else { - params.limit = (!limit || leftToFetch > batchSize) ? - batchSize : leftToFetch; - } +function mangle(key) { + return '$' + key; +} +function unmangle(key) { + return key.substring(1); +} +function Map$1() { + this._store = {}; +} +Map$1.prototype.get = function (key) { + var mangled = mangle(key); + return this._store[mangled]; +}; +Map$1.prototype.set = function (key, value) { + var mangled = mangle(key); + this._store[mangled] = value; + return true; +}; +Map$1.prototype.has = function (key) { + var mangled = mangle(key); + return mangled in this._store; +}; +Map$1.prototype.delete = function (key) { + var mangled = mangle(key); + var res = mangled in this._store; + delete this._store[mangled]; + return res; +}; +Map$1.prototype.forEach = function (cb) { + var keys = Object.keys(this._store); + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i]; + var value = this._store[key]; + key = unmangle(key); + cb(value, key); + } +}; +Object.defineProperty(Map$1.prototype, 'size', { + get: function () { + return Object.keys(this._store).length; + } +}); - // Set the options for the ajax call - var xhrOpts = { - method: method, - url: genDBUrl(host, '_changes' + paramsToStr(params)), - timeout: requestTimeout, - body: body - }; - lastFetchedSeq = since; +function Set$1(array) { + this._store = new Map$1(); - /* istanbul ignore if */ - if (opts.aborted) { - return; - } + // init with an array + if (array && Array.isArray(array)) { + for (var i = 0, len = array.length; i < len; i++) { + this.add(array[i]); + } + } +} +Set$1.prototype.add = function (key) { + return this._store.set(key, true); +}; +Set$1.prototype.has = function (key) { + return this._store.has(key); +}; +Set$1.prototype.forEach = function (cb) { + this._store.forEach(function (value, key) { + cb(key); + }); +}; +Object.defineProperty(Set$1.prototype, 'size', { + get: function () { + return this._store.size; + } +}); - // Get the changes - setup().then(function () { - xhr = ajax(opts, xhrOpts, callback); - }).catch(callback); - }; +/* global Map,Set,Symbol */ +// Based on https://kangax.github.io/compat-table/es6/ we can sniff out +// incomplete Map/Set implementations which would otherwise cause our tests to fail. +// Notably they fail in IE11 and iOS 8.4, which this prevents. +function supportsMapAndSet() { + if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') { + return false; + } + var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species); + return prop && 'get' in prop && Map[Symbol.species] === Map; +} - // If opts.since exists, get all the changes from the sequence - // number given by opts.since. Otherwise, get all the changes - // from the sequence number 0. - var results = {results: []}; +// based on https://github.com/montagejs/collections +/* global Map,Set */ - var fetched = function (err, res) { - if (opts.aborted) { - return; - } - var raw_results_length = 0; - // If the result of the ajax call (res) contains changes (res.results) - if (res && res.results) { - raw_results_length = res.results.length; - results.last_seq = res.last_seq; - var pending = null; - var lastSeq = null; - // Attach 'pending' property if server supports it (CouchDB 2.0+) - /* istanbul ignore if */ - if (typeof res.pending === 'number') { - pending = res.pending; - } - if (typeof results.last_seq === 'string' || typeof results.last_seq === 'number') { - lastSeq = results.last_seq; - } - // For each change - var req = {}; - req.query = opts.query_params; - res.results = res.results.filter(function (c) { - leftToFetch--; - var ret = pouchdbUtils.filterChange(opts)(c); - if (ret) { - if (opts.include_docs && opts.attachments && opts.binary) { - readAttachmentsAsBlobOrBuffer(c); - } - if (returnDocs) { - results.results.push(c); - } - opts.onChange(c, pending, lastSeq); - } - return ret; - }); - } else if (err) { - // In case of an error, stop listening for changes and call - // opts.complete - opts.aborted = true; - opts.complete(err); - return; - } +{ + if (supportsMapAndSet()) { // prefer built-in Map/Set + exports.Set = Set; + exports.Map = Map; + } else { // fall back to our polyfill + exports.Set = Set$1; + exports.Map = Map$1; + } +} - // The changes feed may have timed out with no results - // if so reuse last update sequence - if (res && res.last_seq) { - lastFetchedSeq = res.last_seq; - } +},{}],509:[function(require,module,exports){ +'use strict'; - var finished = (limit && leftToFetch <= 0) || - (res && raw_results_length < batchSize) || - (opts.descending); +Object.defineProperty(exports, '__esModule', { value: true }); - if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) { - // Queue a call to fetch again with the newest sequence number - pouchdbUtils.nextTick(function () { fetch(lastFetchedSeq, fetched); }); - } else { - // We're done, call the callback - opts.complete(null, results); - } - }; +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - fetch(opts.since || 0, fetched); +var inherits = _interopDefault(require('inherits')); - // Return a method to cancel this method from processing any more - return { - cancel: function () { - opts.aborted = true; - if (xhr) { - xhr.abort(); - } - } - }; - }; +inherits(PouchError, Error); - // Given a set of document/revision IDs (given by req), tets the subset of - // those that do NOT correspond to revisions stored in the database. - // See http://wiki.apache.org/couchdb/HttpPostRevsDiff - api.revsDiff = adapterFun$$1('revsDiff', function (req, opts, callback) { - // If no options were given, set the callback to be the second parameter - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } +function PouchError(status, error, reason) { + Error.call(this, reason); + this.status = status; + this.name = error; + this.message = reason; + this.error = true; +} - // Get the missing document/revision IDs - ajax(opts, { - method: 'POST', - url: genDBUrl(host, '_revs_diff'), - body: req - }, callback); +PouchError.prototype.toString = function () { + return JSON.stringify({ + status: this.status, + name: this.name, + message: this.message, + reason: this.reason }); +}; - api._close = function (callback) { - callback(); - }; +var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); +var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); +var MISSING_DOC = new PouchError(404, 'not_found', 'missing'); +var REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict'); +var INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string'); +var MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts'); +var RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.'); +var NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open'); +var UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error'); +var BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid'); +var INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid'); +var QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid'); +var DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member'); +var BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request'); +var NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object'); +var DB_MISSING = new PouchError(404, 'not_found', 'Database not found'); +var IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown'); +var WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown'); +var LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown'); +var FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function'); +var INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format'); +var FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.'); +var MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\'t found'); +var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid'); - api._destroy = function (options, callback) { - ajax(options, { - url: genDBUrl(host, ''), - method: 'DELETE' - }, function (err, resp) { - if (err && err.status && err.status !== 404) { - return callback(err); +function createError(error, reason) { + function CustomPouchError(reason) { + // inherit error properties from our parent error manually + // so as to allow proper JSON parsing. + /* jshint ignore:start */ + for (var p in error) { + if (typeof error[p] !== 'function') { + this[p] = error[p]; } - callback(null, resp); - }); - }; + } + /* jshint ignore:end */ + if (reason !== undefined) { + this.reason = reason; + } + } + CustomPouchError.prototype = PouchError.prototype; + return new CustomPouchError(reason); } -// HttpPouch is a valid adapter. -HttpPouch.valid = function () { - return true; -}; +function generateErrorFromResponse(err) { -function index (PouchDB) { - PouchDB.adapter('http', HttpPouch, false); - PouchDB.adapter('https', HttpPouch, false); + if (typeof err !== 'object') { + var data = err; + err = UNKNOWN_ERROR; + err.data = data; + } + + if ('error' in err && err.error === 'conflict') { + err.name = 'conflict'; + err.status = 409; + } + + if (!('name' in err)) { + err.name = err.error || 'unknown'; + } + + if (!('status' in err)) { + err.status = 500; + } + + if (!('message' in err)) { + err.message = err.message || err.reason; + } + + return err; } -module.exports = index; +exports.UNAUTHORIZED = UNAUTHORIZED; +exports.MISSING_BULK_DOCS = MISSING_BULK_DOCS; +exports.MISSING_DOC = MISSING_DOC; +exports.REV_CONFLICT = REV_CONFLICT; +exports.INVALID_ID = INVALID_ID; +exports.MISSING_ID = MISSING_ID; +exports.RESERVED_ID = RESERVED_ID; +exports.NOT_OPEN = NOT_OPEN; +exports.UNKNOWN_ERROR = UNKNOWN_ERROR; +exports.BAD_ARG = BAD_ARG; +exports.INVALID_REQUEST = INVALID_REQUEST; +exports.QUERY_PARSE_ERROR = QUERY_PARSE_ERROR; +exports.DOC_VALIDATION = DOC_VALIDATION; +exports.BAD_REQUEST = BAD_REQUEST; +exports.NOT_AN_OBJECT = NOT_AN_OBJECT; +exports.DB_MISSING = DB_MISSING; +exports.WSQ_ERROR = WSQ_ERROR; +exports.LDB_ERROR = LDB_ERROR; +exports.FORBIDDEN = FORBIDDEN; +exports.INVALID_REV = INVALID_REV; +exports.FILE_EXISTS = FILE_EXISTS; +exports.MISSING_STUB = MISSING_STUB; +exports.IDB_ERROR = IDB_ERROR; +exports.INVALID_URL = INVALID_URL; +exports.createError = createError; +exports.generateErrorFromResponse = generateErrorFromResponse; -},{"argsarray":39,"pouchdb-ajax":515,"pouchdb-binary-utils":517,"pouchdb-errors":529,"pouchdb-promise":508,"pouchdb-utils":542}],508:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],509:[function(require,module,exports){ +},{"inherits":495}],510:[function(require,module,exports){ 'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var pouchdbCollections = require('pouchdb-collections'); -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbMerge = require('pouchdb-merge'); -var pouchdbErrors = require('pouchdb-errors'); -var pouchdbAdapterUtils = require('pouchdb-adapter-utils'); -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbJson = require('pouchdb-json'); -var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var lie = _interopDefault(require('lie')); -// IndexedDB requires a versioned database structure, so we use the -// version here to manage migrations. -var ADAPTER_VERSION = 5; +/* istanbul ignore next */ +var PouchPromise = typeof Promise === 'function' ? Promise : lie; -// The object stores created for each database -// DOC_STORE stores the document meta data, its revision history and state -// Keyed by document id -var DOC_STORE = 'document-store'; -// BY_SEQ_STORE stores a particular version of a document, keyed by its -// sequence id -var BY_SEQ_STORE = 'by-sequence'; -// Where we store attachments -var ATTACH_STORE = 'attach-store'; -// Where we store many-to-many relations -// between attachment digests and seqs -var ATTACH_AND_SEQ_STORE = 'attach-seq-store'; +module.exports = PouchPromise; -// Where we store database-wide meta data in a single record -// keyed by id: META_STORE -var META_STORE = 'meta-store'; -// Where we store local documents -var LOCAL_STORE = 'local-store'; -// Where we detect blob support -var DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support'; +},{"lie":500}],511:[function(require,module,exports){ +'use strict'; -function idbError(callback) { - return function (evt) { - var message = 'unknown_error'; - if (evt.target && evt.target.error) { - message = evt.target.error.name || evt.target.error.message; - } - callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, message, evt.type)); - }; -} +Object.defineProperty(exports, '__esModule', { value: true }); -// Unfortunately, the metadata has to be stringified -// when it is put into the database, because otherwise -// IndexedDB can throw errors for deeply-nested objects. -// Originally we just used JSON.parse/JSON.stringify; now -// we use this custom vuvuzela library that avoids recursion. -// If we could do it all over again, we'd probably use a -// format for the revision trees other than JSON. -function encodeMetadata(metadata, winningRev$$1, deleted) { - return { - data: pouchdbJson.safeJsonStringify(metadata), - winningRev: winningRev$$1, - deletedOrLocal: deleted ? '1' : '0', - seq: metadata.seq, // highest seq for this doc - id: metadata.id - }; +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var getArguments = _interopDefault(require('argsarray')); +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbCollections = require('pouchdb-collections'); +var immediate = _interopDefault(require('immediate')); +var events = require('events'); +var inherits = _interopDefault(require('inherits')); +var pouchdbErrors = require('pouchdb-errors'); +var uuidV4 = _interopDefault(require('uuid')); + +function isBinaryObject(object) { + return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) || + (typeof Blob !== 'undefined' && object instanceof Blob); } -function decodeMetadata(storedObject) { - if (!storedObject) { - return null; +function cloneArrayBuffer(buff) { + if (typeof buff.slice === 'function') { + return buff.slice(0); } - var metadata = pouchdbJson.safeJsonParse(storedObject.data); - metadata.winningRev = storedObject.winningRev; - metadata.deleted = storedObject.deletedOrLocal === '1'; - metadata.seq = storedObject.seq; - return metadata; + // IE10-11 slice() polyfill + var target = new ArrayBuffer(buff.byteLength); + var targetArray = new Uint8Array(target); + var sourceArray = new Uint8Array(buff); + targetArray.set(sourceArray); + return target; } -// read the doc back out from the database. we don't store the -// _id or _rev because we already have _doc_id_rev. -function decodeDoc(doc) { - if (!doc) { - return doc; +function cloneBinaryObject(object) { + if (object instanceof ArrayBuffer) { + return cloneArrayBuffer(object); } - var idx = doc._doc_id_rev.lastIndexOf(':'); - doc._id = doc._doc_id_rev.substring(0, idx - 1); - doc._rev = doc._doc_id_rev.substring(idx + 1); - delete doc._doc_id_rev; - return doc; + var size = object.size; + var type = object.type; + // Blob + if (typeof object.slice === 'function') { + return object.slice(0, size, type); + } + // PhantomJS slice() replacement + return object.webkitSlice(0, size, type); } -// Read a blob from the database, encoding as necessary -// and translating from base64 if the IDB doesn't support -// native Blobs -function readBlobData(body, type, asBlob, callback) { - if (asBlob) { - if (!body) { - callback(pouchdbBinaryUtils.blob([''], {type: type})); - } else if (typeof body !== 'string') { // we have blob support - callback(body); - } else { // no blob support - callback(pouchdbBinaryUtils.base64StringToBlobOrBuffer(body, type)); - } - } else { // as base64 string - if (!body) { - callback(''); - } else if (typeof body !== 'string') { // we have blob support - pouchdbBinaryUtils.readAsBinaryString(body, function (binary) { - callback(pouchdbBinaryUtils.btoa(binary)); - }); - } else { // no blob support - callback(body); - } +// most of this is borrowed from lodash.isPlainObject: +// https://github.com/fis-components/lodash.isplainobject/ +// blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js + +var funcToString = Function.prototype.toString; +var objectCtorString = funcToString.call(Object); + +function isPlainObject(value) { + var proto = Object.getPrototypeOf(value); + /* istanbul ignore if */ + if (proto === null) { // not sure when this happens, but I guess it can + return true; } + var Ctor = proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } -function fetchAttachmentsIfNecessary(doc, opts, txn, cb) { - var attachments = Object.keys(doc._attachments || {}); - if (!attachments.length) { - return cb && cb(); +function clone(object) { + var newObject; + var i; + var len; + + if (!object || typeof object !== 'object') { + return object; } - var numDone = 0; - function checkDone() { - if (++numDone === attachments.length && cb) { - cb(); + if (Array.isArray(object)) { + newObject = []; + for (i = 0, len = object.length; i < len; i++) { + newObject[i] = clone(object[i]); } + return newObject; } - function fetchAttachment(doc, att) { - var attObj = doc._attachments[att]; - var digest = attObj.digest; - var req = txn.objectStore(ATTACH_STORE).get(digest); - req.onsuccess = function (e) { - attObj.body = e.target.result.body; - checkDone(); - }; + // special case: to avoid inconsistencies between IndexedDB + // and other backends, we automatically stringify Dates + if (object instanceof Date) { + return object.toISOString(); } - attachments.forEach(function (att) { - if (opts.attachments && opts.include_docs) { - fetchAttachment(doc, att); - } else { - doc._attachments[att].stub = true; - checkDone(); - } - }); -} - -// IDB-specific postprocessing necessary because -// we don't know whether we stored a true Blob or -// a base64-encoded string, and if it's a Blob it -// needs to be read outside of the transaction context -function postProcessAttachments(results, asBlob) { - return Promise.all(results.map(function (row) { - if (row.doc && row.doc._attachments) { - var attNames = Object.keys(row.doc._attachments); - return Promise.all(attNames.map(function (att) { - var attObj = row.doc._attachments[att]; - if (!('body' in attObj)) { // already processed - return; - } - var body = attObj.body; - var type = attObj.content_type; - return new Promise(function (resolve) { - readBlobData(body, type, asBlob, function (data) { - row.doc._attachments[att] = pouchdbUtils.assign( - pouchdbUtils.pick(attObj, ['digest', 'content_type']), - {data: data} - ); - resolve(); - }); - }); - })); - } - })); -} - -function compactRevs(revs, docId, txn) { - - var possiblyOrphanedDigests = []; - var seqStore = txn.objectStore(BY_SEQ_STORE); - var attStore = txn.objectStore(ATTACH_STORE); - var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); - var count = revs.length; - - function checkDone() { - count--; - if (!count) { // done processing all revs - deleteOrphanedAttachments(); - } + if (isBinaryObject(object)) { + return cloneBinaryObject(object); } - function deleteOrphanedAttachments() { - if (!possiblyOrphanedDigests.length) { - return; - } - possiblyOrphanedDigests.forEach(function (digest) { - var countReq = attAndSeqStore.index('digestSeq').count( - IDBKeyRange.bound( - digest + '::', digest + '::\uffff', false, false)); - countReq.onsuccess = function (e) { - var count = e.target.result; - if (!count) { - // orphaned - attStore.delete(digest); - } - }; - }); + if (!isPlainObject(object)) { + return object; // don't clone objects like Workers } - revs.forEach(function (rev) { - var index = seqStore.index('_doc_id_rev'); - var key = docId + "::" + rev; - index.getKey(key).onsuccess = function (e) { - var seq = e.target.result; - if (typeof seq !== 'number') { - return checkDone(); + newObject = {}; + for (i in object) { + /* istanbul ignore else */ + if (Object.prototype.hasOwnProperty.call(object, i)) { + var value = clone(object[i]); + if (typeof value !== 'undefined') { + newObject[i] = value; } - seqStore.delete(seq); + } + } + return newObject; +} - var cursor = attAndSeqStore.index('seq') - .openCursor(IDBKeyRange.only(seq)); +function once(fun) { + var called = false; + return getArguments(function (args) { + /* istanbul ignore if */ + if (called) { + // this is a smoke test and should never actually happen + throw new Error('once called more than once'); + } else { + called = true; + fun.apply(this, args); + } + }); +} - cursor.onsuccess = function (event) { - var cursor = event.target.result; - if (cursor) { - var digest = cursor.value.digestSeq.split('::')[0]; - possiblyOrphanedDigests.push(digest); - attAndSeqStore.delete(cursor.primaryKey); - cursor.continue(); - } else { // done - checkDone(); +function toPromise(func) { + //create the function we will be returning + return getArguments(function (args) { + // Clone arguments + args = clone(args); + var self = this; + // if the last argument is a function, assume its a callback + var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false; + var promise = new Promise(function (fulfill, reject) { + var resp; + try { + var callback = once(function (err, mesg) { + if (err) { + reject(err); + } else { + fulfill(mesg); + } + }); + // create a callback for this invocation + // apply the function in the orig context + args.push(callback); + resp = func.apply(self, args); + if (resp && typeof resp.then === 'function') { + fulfill(resp); } - }; - }; + } catch (e) { + reject(e); + } + }); + // if there is a callback, call it back + if (usedCB) { + promise.then(function (result) { + usedCB(null, result); + }, usedCB); + } + return promise; }); } -function openTransactionSafely(idb, stores, mode) { - try { - return { - txn: idb.transaction(stores, mode) - }; - } catch (err) { - return { - error: err +function logApiCall(self, name, args) { + /* istanbul ignore if */ + if (self.constructor.listeners('debug').length) { + var logArgs = ['api', self.name, name]; + for (var i = 0; i < args.length - 1; i++) { + logArgs.push(args[i]); + } + self.constructor.emit('debug', logArgs); + + // override the callback itself to log the response + var origCallback = args[args.length - 1]; + args[args.length - 1] = function (err, res) { + var responseArgs = ['api', self.name, name]; + responseArgs = responseArgs.concat( + err ? ['error', err] : ['success', res] + ); + self.constructor.emit('debug', responseArgs); + origCallback(err, res); }; } } -var changesHandler$1 = new pouchdbUtils.changesHandler(); - -function idbBulkDocs(dbOpts, req, opts, api, idb, callback) { - var docInfos = req.docs; - var txn; - var docStore; - var bySeqStore; - var attachStore; - var attachAndSeqStore; - var metaStore; - var docInfoError; - var metaDoc; - - for (var i = 0, len = docInfos.length; i < len; i++) { - var doc = docInfos[i]; - if (doc._id && pouchdbAdapterUtils.isLocalId(doc._id)) { - continue; +function adapterFun(name, callback) { + return toPromise(getArguments(function (args) { + if (this._closed) { + return Promise.reject(new Error('database is closed')); } - doc = docInfos[i] = pouchdbAdapterUtils.parseDoc(doc, opts.new_edits); - if (doc.error && !docInfoError) { - docInfoError = doc; + if (this._destroyed) { + return Promise.reject(new Error('database is destroyed')); } - } + var self = this; + logApiCall(self, name, args); + if (!this.taskqueue.isReady) { + return new Promise(function (fulfill, reject) { + self.taskqueue.addTask(function (failed) { + if (failed) { + reject(failed); + } else { + fulfill(self[name].apply(self, args)); + } + }); + }); + } + return callback.apply(this, args); + })); +} - if (docInfoError) { - return callback(docInfoError); +// like underscore/lodash _.pick() +function pick(obj, arr) { + var res = {}; + for (var i = 0, len = arr.length; i < len; i++) { + var prop = arr[i]; + if (prop in obj) { + res[prop] = obj[prop]; + } } + return res; +} - var allDocsProcessed = false; - var docCountDelta = 0; - var results = new Array(docInfos.length); - var fetchedDocs = new pouchdbCollections.Map(); - var preconditionErrored = false; - var blobType = api._meta.blobSupport ? 'blob' : 'base64'; +// Most browsers throttle concurrent requests at 6, so it's silly +// to shim _bulk_get by trying to launch potentially hundreds of requests +// and then letting the majority time out. We can handle this ourselves. +var MAX_NUM_CONCURRENT_REQUESTS = 6; - pouchdbAdapterUtils.preprocessAttachments(docInfos, blobType, function (err) { - if (err) { - return callback(err); - } - startTransaction(); - }); +function identityFunction(x) { + return x; +} - function startTransaction() { +function formatResultForOpenRevsGet(result) { + return [{ + ok: result + }]; +} - var stores = [ - DOC_STORE, BY_SEQ_STORE, - ATTACH_STORE, - LOCAL_STORE, ATTACH_AND_SEQ_STORE, - META_STORE - ]; - var txnResult = openTransactionSafely(idb, stores, 'readwrite'); - if (txnResult.error) { - return callback(txnResult.error); +// shim for P/CouchDB adapters that don't directly implement _bulk_get +function bulkGet(db, opts, callback) { + var requests = opts.docs; + + // consolidate into one request per doc if possible + var requestsById = new pouchdbCollections.Map(); + requests.forEach(function (request) { + if (requestsById.has(request.id)) { + requestsById.get(request.id).push(request); + } else { + requestsById.set(request.id, [request]); } - txn = txnResult.txn; - txn.onabort = idbError(callback); - txn.ontimeout = idbError(callback); - txn.oncomplete = complete; - docStore = txn.objectStore(DOC_STORE); - bySeqStore = txn.objectStore(BY_SEQ_STORE); - attachStore = txn.objectStore(ATTACH_STORE); - attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); - metaStore = txn.objectStore(META_STORE); + }); - metaStore.get(META_STORE).onsuccess = function (e) { - metaDoc = e.target.result; - updateDocCountIfReady(); - }; + var numDocs = requestsById.size; + var numDone = 0; + var perDocResults = new Array(numDocs); - verifyAttachments(function (err) { - if (err) { - preconditionErrored = true; - return callback(err); - } - fetchExistingDocs(); + function collapseResultsAndFinish() { + var results = []; + perDocResults.forEach(function (res) { + res.docs.forEach(function (info) { + results.push({ + id: res.id, + docs: [info] + }); + }); }); + callback(null, {results: results}); } - function onAllDocsProcessed() { - allDocsProcessed = true; - updateDocCountIfReady(); - } - - function idbProcessDocs() { - pouchdbAdapterUtils.processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, - txn, results, writeDoc, opts, onAllDocsProcessed); - } - - function updateDocCountIfReady() { - if (!metaDoc || !allDocsProcessed) { - return; + function checkDone() { + if (++numDone === numDocs) { + collapseResultsAndFinish(); } - // caching the docCount saves a lot of time in allDocs() and - // info(), which is why we go to all the trouble of doing this - metaDoc.docCount += docCountDelta; - metaStore.put(metaDoc); } - function fetchExistingDocs() { - - if (!docInfos.length) { - return; - } - - var numFetched = 0; - - function checkDone() { - if (++numFetched === docInfos.length) { - idbProcessDocs(); - } - } + function gotResult(docIndex, id, docs) { + perDocResults[docIndex] = {id: id, docs: docs}; + checkDone(); + } - function readMetadata(event) { - var metadata = decodeMetadata(event.target.result); + var allRequests = []; + requestsById.forEach(function (value, key) { + allRequests.push(key); + }); - if (metadata) { - fetchedDocs.set(metadata.id, metadata); - } - checkDone(); - } + var i = 0; - for (var i = 0, len = docInfos.length; i < len; i++) { - var docInfo = docInfos[i]; - if (docInfo._id && pouchdbAdapterUtils.isLocalId(docInfo._id)) { - checkDone(); // skip local docs - continue; - } - var req = docStore.get(docInfo.metadata.id); - req.onsuccess = readMetadata; - } - } + function nextBatch() { - function complete() { - if (preconditionErrored) { + if (i >= allRequests.length) { return; } - changesHandler$1.notify(api._meta.name); - callback(null, results); + var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length); + var batch = allRequests.slice(i, upTo); + processBatch(batch, i); + i += batch.length; } - function verifyAttachment(digest, callback) { + function processBatch(batch, offset) { + batch.forEach(function (docId, j) { + var docIdx = offset + j; + var docRequests = requestsById.get(docId); - var req = attachStore.get(digest); - req.onsuccess = function (e) { - if (!e.target.result) { - var err = pouchdbErrors.createError(pouchdbErrors.MISSING_STUB, - 'unknown stub attachment with digest ' + - digest); - err.status = 412; - callback(err); - } else { - callback(); - } - }; - } + // just use the first request as the "template" + // TODO: The _bulk_get API allows for more subtle use cases than this, + // but for now it is unlikely that there will be a mix of different + // "atts_since" or "attachments" in the same request, since it's just + // replicate.js that is using this for the moment. + // Also, atts_since is aspirational, since we don't support it yet. + var docOpts = pick(docRequests[0], ['atts_since', 'attachments']); + docOpts.open_revs = docRequests.map(function (request) { + // rev is optional, open_revs disallowed + return request.rev; + }); - function verifyAttachments(finish) { + // remove falsey / undefined revisions + docOpts.open_revs = docOpts.open_revs.filter(identityFunction); + var formatResult = identityFunction; - var digests = []; - docInfos.forEach(function (docInfo) { - if (docInfo.data && docInfo.data._attachments) { - Object.keys(docInfo.data._attachments).forEach(function (filename) { - var att = docInfo.data._attachments[filename]; - if (att.stub) { - digests.push(att.digest); - } - }); - } - }); - if (!digests.length) { - return finish(); - } - var numDone = 0; - var err; + if (docOpts.open_revs.length === 0) { + delete docOpts.open_revs; - function checkDone() { - if (++numDone === digests.length) { - finish(err); + // when fetching only the "winning" leaf, + // transform the result so it looks like an open_revs + // request + formatResult = formatResultForOpenRevsGet; } - } - digests.forEach(function (digest) { - verifyAttachment(digest, function (attErr) { - if (attErr && !err) { - err = attErr; + + // globally-supplied options + ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) { + if (param in opts) { + docOpts[param] = opts[param]; } - checkDone(); + }); + db.get(docId, docOpts, function (err, res) { + var result; + /* istanbul ignore if */ + if (err) { + result = [{error: err}]; + } else { + result = formatResult(res); + } + gotResult(docIdx, docId, result); + nextBatch(); }); }); } - function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, - isUpdate, delta, resultsIdx, callback) { - - docInfo.metadata.winningRev = winningRev$$1; - docInfo.metadata.deleted = winningRevIsDeleted; - - var doc = docInfo.data; - doc._id = docInfo.metadata.id; - doc._rev = docInfo.metadata.rev; + nextBatch(); - if (newRevIsDeleted) { - doc._deleted = true; - } +} - var hasAttachments = doc._attachments && - Object.keys(doc._attachments).length; - if (hasAttachments) { - return writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, - isUpdate, resultsIdx, callback); - } +function isChromeApp() { + return (typeof chrome !== "undefined" && + typeof chrome.storage !== "undefined" && + typeof chrome.storage.local !== "undefined"); +} - docCountDelta += delta; - updateDocCountIfReady(); +var hasLocal; - finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, - isUpdate, resultsIdx, callback); +if (isChromeApp()) { + hasLocal = false; +} else { + try { + localStorage.setItem('_pouch_check_localstorage', 1); + hasLocal = !!localStorage.getItem('_pouch_check_localstorage'); + } catch (e) { + hasLocal = false; } +} - function finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, - isUpdate, resultsIdx, callback) { - - var doc = docInfo.data; - var metadata = docInfo.metadata; +function hasLocalStorage() { + return hasLocal; +} - doc._doc_id_rev = metadata.id + '::' + metadata.rev; - delete doc._id; - delete doc._rev; +// Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We +// avoid using process.nextTick() directly because the polyfill is very large and we don't +// need all of it (see: https://github.com/defunctzombie/node-process). +// "immediate" 3.0.8 is used by lie, and it's a smaller version of the latest "immediate" +// package, so it's the one we use. +// When we use nextTick() in our codebase, we only care about not releasing Zalgo +// (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). +// Microtask vs macrotask doesn't matter to us. So we're free to use the fastest +// (least latency) option, which is "immediate" due to use of microtasks. +// All of our nextTicks are isolated to this one function so we can easily swap out one +// implementation for another. - function afterPutDoc(e) { - var revsToDelete = docInfo.stemmedRevs || []; +inherits(Changes, events.EventEmitter); - if (isUpdate && api.auto_compaction) { - revsToDelete = revsToDelete.concat(pouchdbMerge.compactTree(docInfo.metadata)); +/* istanbul ignore next */ +function attachBrowserEvents(self) { + if (isChromeApp()) { + chrome.storage.onChanged.addListener(function (e) { + // make sure it's event addressed to us + if (e.db_name != null) { + //object only has oldValue, newValue members + self.emit(e.dbName.newValue); } + }); + } else if (hasLocalStorage()) { + if (typeof addEventListener !== 'undefined') { + addEventListener("storage", function (e) { + self.emit(e.key); + }); + } else { // old IE + window.attachEvent("storage", function (e) { + self.emit(e.key); + }); + } + } +} - if (revsToDelete && revsToDelete.length) { - compactRevs(revsToDelete, docInfo.metadata.id, txn); - } +function Changes() { + events.EventEmitter.call(this); + this._listeners = {}; - metadata.seq = e.target.result; - // Current _rev is calculated from _rev_tree on read - // delete metadata.rev; - var metadataToStore = encodeMetadata(metadata, winningRev$$1, - winningRevIsDeleted); - var metaDataReq = docStore.put(metadataToStore); - metaDataReq.onsuccess = afterPutMetadata; + attachBrowserEvents(this); +} +Changes.prototype.addListener = function (dbName, id, db, opts) { + /* istanbul ignore if */ + if (this._listeners[id]) { + return; + } + var self = this; + var inprogress = false; + function eventFunction() { + /* istanbul ignore if */ + if (!self._listeners[id]) { + return; } - - function afterPutDocError(e) { - // ConstraintError, need to update, not put (see #1638 for details) - e.preventDefault(); // avoid transaction abort - e.stopPropagation(); // avoid transaction onerror - var index = bySeqStore.index('_doc_id_rev'); - var getKeyReq = index.getKey(doc._doc_id_rev); - getKeyReq.onsuccess = function (e) { - var putReq = bySeqStore.put(doc, e.target.result); - putReq.onsuccess = afterPutDoc; - }; + if (inprogress) { + inprogress = 'waiting'; + return; } + inprogress = true; + var changesOpts = pick(opts, [ + 'style', 'include_docs', 'attachments', 'conflicts', 'filter', + 'doc_ids', 'view', 'since', 'query_params', 'binary' + ]); - function afterPutMetadata() { - results[resultsIdx] = { - ok: true, - id: metadata.id, - rev: metadata.rev - }; - fetchedDocs.set(docInfo.metadata.id, docInfo.metadata); - insertAttachmentMappings(docInfo, metadata.seq, callback); + /* istanbul ignore next */ + function onError() { + inprogress = false; } - var putReq = bySeqStore.put(doc); + db.changes(changesOpts).on('change', function (c) { + if (c.seq > opts.since && !opts.cancelled) { + opts.since = c.seq; + opts.onChange(c); + } + }).on('complete', function () { + if (inprogress === 'waiting') { + immediate(eventFunction); + } + inprogress = false; + }).on('error', onError); + } + this._listeners[id] = eventFunction; + this.on(dbName, eventFunction); +}; - putReq.onsuccess = afterPutDoc; - putReq.onerror = afterPutDocError; +Changes.prototype.removeListener = function (dbName, id) { + /* istanbul ignore if */ + if (!(id in this._listeners)) { + return; } + events.EventEmitter.prototype.removeListener.call(this, dbName, + this._listeners[id]); + delete this._listeners[id]; +}; - function writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, - isUpdate, resultsIdx, callback) { +/* istanbul ignore next */ +Changes.prototype.notifyLocalWindows = function (dbName) { + //do a useless change on a storage thing + //in order to get other windows's listeners to activate + if (isChromeApp()) { + chrome.storage.local.set({dbName: dbName}); + } else if (hasLocalStorage()) { + localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a"; + } +}; - var doc = docInfo.data; +Changes.prototype.notify = function (dbName) { + this.emit(dbName); + this.notifyLocalWindows(dbName); +}; - var numDone = 0; - var attachments = Object.keys(doc._attachments); +function guardedConsole(method) { + /* istanbul ignore else */ + if (typeof console !== 'undefined' && typeof console[method] === 'function') { + var args = Array.prototype.slice.call(arguments, 1); + console[method].apply(console, args); + } +} - function collectResults() { - if (numDone === attachments.length) { - finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, - isUpdate, resultsIdx, callback); - } - } +function randomNumber(min, max) { + var maxTimeout = 600000; // Hard-coded default of 10 minutes + min = parseInt(min, 10) || 0; + max = parseInt(max, 10); + if (max !== max || max <= min) { + max = (min || 1) << 1; //doubling + } else { + max = max + 1; + } + // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout + if (max > maxTimeout) { + min = maxTimeout >> 1; // divide by two + max = maxTimeout; + } + var ratio = Math.random(); + var range = max - min; - function attachmentSaved() { - numDone++; - collectResults(); - } + return ~~(range * ratio + min); // ~~ coerces to an int, but fast. +} - attachments.forEach(function (key) { - var att = docInfo.data._attachments[key]; - if (!att.stub) { - var data = att.data; - delete att.data; - att.revpos = parseInt(winningRev$$1, 10); - var digest = att.digest; - saveAttachment(digest, data, attachmentSaved); - } else { - numDone++; - collectResults(); - } - }); +function defaultBackOff(min) { + var max = 0; + if (!min) { + max = 2000; } + return randomNumber(min, max); +} - // map seqs to attachment digests, which - // we will need later during compaction - function insertAttachmentMappings(docInfo, seq, callback) { +// designed to give info to browser users, who are disturbed +// when they see http errors in the console +function explainError(status, str) { + guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str); +} - var attsAdded = 0; - var attsToAdd = Object.keys(docInfo.data._attachments || {}); +var assign; +{ + if (typeof Object.assign === 'function') { + assign = Object.assign; + } else { + // lite Object.assign polyfill based on + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign + assign = function (target) { + var to = Object(target); - if (!attsToAdd.length) { - return callback(); - } + for (var index = 1; index < arguments.length; index++) { + var nextSource = arguments[index]; - function checkDone() { - if (++attsAdded === attsToAdd.length) { - callback(); + if (nextSource != null) { // Skip over if undefined or null + for (var nextKey in nextSource) { + // Avoid bugs when hasOwnProperty is shadowed + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } } - } - - function add(att) { - var digest = docInfo.data._attachments[att].digest; - var req = attachAndSeqStore.put({ - seq: seq, - digestSeq: digest + '::' + seq - }); - - req.onsuccess = checkDone; - req.onerror = function (e) { - // this callback is for a constaint error, which we ignore - // because this docid/rev has already been associated with - // the digest (e.g. when new_edits == false) - e.preventDefault(); // avoid transaction abort - e.stopPropagation(); // avoid transaction onerror - checkDone(); - }; - } - for (var i = 0; i < attsToAdd.length; i++) { - add(attsToAdd[i]); // do in parallel - } + return to; + }; } +} - function saveAttachment(digest, data, callback) { - +var assign$1 = assign; - var getKeyReq = attachStore.count(digest); - getKeyReq.onsuccess = function (e) { - var count = e.target.result; - if (count) { - return callback(); // already exists - } - var newAtt = { - digest: digest, - body: data - }; - var putReq = attachStore.put(newAtt); - putReq.onsuccess = callback; - }; +function tryFilter(filter, doc, req) { + try { + return !filter(doc, req); + } catch (err) { + var msg = 'Filter function threw: ' + err.toString(); + return pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, msg); } } -// Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations -// while falling back to a normal IDBCursor operation on browsers that don't support getAll() or -// getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because -// we're not processing each document one-at-a-time. -function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) { - - // Bail out of getAll()/getAllKeys() in the following cases: - // 1) either method is unsupported - we need both - // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited, - // not really clear the user wants a batched approach where the entire DB is read into memory, - // perhaps they are filtering on a per-doc basis) - // 3) descending – no real way to do this via getAll()/getAllKeys() +function filterChange(opts) { + var req = {}; + var hasFilter = opts.filter && typeof opts.filter === 'function'; + req.query = opts.query_params; - var useGetAll = typeof objectStore.getAll === 'function' && - typeof objectStore.getAllKeys === 'function' && - batchSize > 1 && !descending; + return function filter(change) { + if (!change.doc) { + // CSG sends events on the changes feed that don't have documents, + // this hack makes a whole lot of existing code robust. + change.doc = {}; + } - var keysBatch; - var valuesBatch; - var pseudoCursor; + var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req); - function onGetAll(e) { - valuesBatch = e.target.result; - if (keysBatch) { - onBatch(keysBatch, valuesBatch, pseudoCursor); + if (typeof filterReturn === 'object') { + return filterReturn; } - } - function onGetAllKeys(e) { - keysBatch = e.target.result; - if (valuesBatch) { - onBatch(keysBatch, valuesBatch, pseudoCursor); + if (filterReturn) { + return false; } - } - function continuePseudoCursor() { - if (!keysBatch.length) { // no more results - return onBatch(); - } - // fetch next batch, exclusive start - var lastKey = keysBatch[keysBatch.length - 1]; - var newKeyRange; - if (keyRange && keyRange.upper) { - try { - newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper, - true, keyRange.upperOpen); - } catch (e) { - if (e.name === "DataError" && e.code === 0) { - return onBatch(); // we're done, startkey and endkey are equal + if (!opts.include_docs) { + delete change.doc; + } else if (!opts.attachments) { + for (var att in change.doc._attachments) { + /* istanbul ignore else */ + if (change.doc._attachments.hasOwnProperty(att)) { + change.doc._attachments[att].stub = true; } } - } else { - newKeyRange = IDBKeyRange.lowerBound(lastKey, true); - } - keyRange = newKeyRange; - keysBatch = null; - valuesBatch = null; - objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; - objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; - } - - function onCursor(e) { - var cursor = e.target.result; - if (!cursor) { // done - return onBatch(); } - // regular IDBCursor acts like a batch where batch size is always 1 - onBatch([cursor.key], [cursor.value], cursor); - } + return true; + }; +} - if (useGetAll) { - pseudoCursor = {"continue": continuePseudoCursor}; - objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; - objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; - } else if (descending) { - objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor; - } else { - objectStore.openCursor(keyRange).onsuccess = onCursor; +function flatten(arrs) { + var res = []; + for (var i = 0, len = arrs.length; i < len; i++) { + res = res.concat(arrs[i]); } + return res; } -// simple shim for objectStore.getAll(), falling back to IDBCursor -function getAll(objectStore, keyRange, onSuccess) { - if (typeof objectStore.getAll === 'function') { - // use native getAll - objectStore.getAll(keyRange).onsuccess = onSuccess; - return; - } - // fall back to cursors - var values = []; +// shim for Function.prototype.name, +// for browsers that don't support it like IE - function onCursor(e) { - var cursor = e.target.result; - if (cursor) { - values.push(cursor.value); - cursor.continue(); - } else { - onSuccess({ - target: { - result: values - } - }); - } - } +/* istanbul ignore next */ +function f() {} - objectStore.openCursor(keyRange).onsuccess = onCursor; -} +var hasName = f.name; +var res; -function allDocsKeys(keys, docStore, onBatch) { - // It's not guaranted to be returned in right order - var valuesBatch = []; - var count = 0; - keys.forEach(function (key, index) { - docStore.get(key).onsuccess = function (event) { - if (event.target.result) { - valuesBatch[index] = event.target.result; - } else { - valuesBatch[index] = {key: key, error: 'not_found'}; - } - count++; - if (count === keys.length) { - onBatch(keys, valuesBatch, {}); - } - }; - }); +// We dont run coverage in IE +/* istanbul ignore else */ +if (hasName) { + res = function (fun) { + return fun.name; + }; +} else { + res = function (fun) { + return fun.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; + }; } -function createKeyRange(start, end, inclusiveEnd, key, descending) { - try { - if (start && end) { - if (descending) { - return IDBKeyRange.bound(end, start, !inclusiveEnd, false); - } else { - return IDBKeyRange.bound(start, end, false, !inclusiveEnd); - } - } else if (start) { - if (descending) { - return IDBKeyRange.upperBound(start); - } else { - return IDBKeyRange.lowerBound(start); - } - } else if (end) { - if (descending) { - return IDBKeyRange.lowerBound(end, !inclusiveEnd); - } else { - return IDBKeyRange.upperBound(end, !inclusiveEnd); - } - } else if (key) { - return IDBKeyRange.only(key); - } - } catch (e) { - return {error: e}; +var res$1 = res; + +// Determine id an ID is valid +// - invalid IDs begin with an underescore that does not begin '_design' or +// '_local' +// - any other string value is a valid id +// Returns the specific error object for each case +function invalidIdError(id) { + var err; + if (!id) { + err = pouchdbErrors.createError(pouchdbErrors.MISSING_ID); + } else if (typeof id !== 'string') { + err = pouchdbErrors.createError(pouchdbErrors.INVALID_ID); + } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) { + err = pouchdbErrors.createError(pouchdbErrors.RESERVED_ID); + } + if (err) { + throw err; } - return null; } -function idbAllDocs(opts, idb, callback) { - var start = 'startkey' in opts ? opts.startkey : false; - var end = 'endkey' in opts ? opts.endkey : false; - var key = 'key' in opts ? opts.key : false; - var keys = 'keys' in opts ? opts.keys : false; - var skip = opts.skip || 0; - var limit = typeof opts.limit === 'number' ? opts.limit : -1; - var inclusiveEnd = opts.inclusive_end !== false; +function isCordova() { + return (typeof cordova !== "undefined" || + typeof PhoneGap !== "undefined" || + typeof phonegap !== "undefined"); +} - var keyRange; - var keyRangeError; - if (!keys) { - keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending); - keyRangeError = keyRange && keyRange.error; - if (keyRangeError && - !(keyRangeError.name === "DataError" && keyRangeError.code === 0)) { - // DataError with error code 0 indicates start is less than end, so - // can just do an empty query. Else need to throw - return callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, - keyRangeError.name, keyRangeError.message)); - } - } +// Checks if a PouchDB object is "remote" or not. This is +// designed to opt-in to certain optimizations, such as +// avoiding checks for "dependentDbs" and other things that +// we know only apply to local databases. In general, "remote" +// should be true for the http adapter, and for third-party +// adapters with similar expensive boundaries to cross for +// every API call, such as socket-pouch and worker-pouch. +// Previously, this was handled via db.type() === 'http' +// which is now deprecated. - var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE]; - - if (opts.attachments) { - stores.push(ATTACH_STORE); +function isRemote(db) { + if (typeof db._remote === 'boolean') { + return db._remote; } - var txnResult = openTransactionSafely(idb, stores, 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); + /* istanbul ignore next */ + if (typeof db.type === 'function') { + guardedConsole('warn', + 'db.type() is deprecated and will be removed in ' + + 'a future version of PouchDB'); + return db.type() === 'http'; } - var txn = txnResult.txn; - txn.oncomplete = onTxnComplete; - txn.onabort = idbError(callback); - var docStore = txn.objectStore(DOC_STORE); - var seqStore = txn.objectStore(BY_SEQ_STORE); - var metaStore = txn.objectStore(META_STORE); - var docIdRevIndex = seqStore.index('_doc_id_rev'); - var results = []; - var docCount; - var updateSeq; + /* istanbul ignore next */ + return false; +} - metaStore.get(META_STORE).onsuccess = function (e) { - docCount = e.target.result.docCount; - }; +function listenerCount(ee, type) { + return 'listenerCount' in ee ? ee.listenerCount(type) : + events.EventEmitter.listenerCount(ee, type); +} - /* istanbul ignore if */ - if (opts.update_seq) { - getMaxUpdateSeq(seqStore, function (e) { - if (e.target.result && e.target.result.length > 0) { - updateSeq = e.target.result[0]; - } - }); +function parseDesignDocFunctionName(s) { + if (!s) { + return null; } - - function getMaxUpdateSeq(objectStore, onSuccess) { - function onCursor(e) { - var cursor = e.target.result; - var maxKey = undefined; - if (cursor && cursor.key) { - maxKey = cursor.key; - } - return onSuccess({ - target: { - result: [maxKey] - } - }); - } - objectStore.openCursor(null, 'prev').onsuccess = onCursor; + var parts = s.split('/'); + if (parts.length === 2) { + return parts; } - - // if the user specifies include_docs=true, then we don't - // want to block the main cursor while we're fetching the doc - function fetchDocAsynchronously(metadata, row, winningRev$$1) { - var key = metadata.id + "::" + winningRev$$1; - docIdRevIndex.get(key).onsuccess = function onGetDoc(e) { - row.doc = decodeDoc(e.target.result); - if (opts.conflicts) { - var conflicts = pouchdbMerge.collectConflicts(metadata); - if (conflicts.length) { - row.doc._conflicts = conflicts; - } - } - fetchAttachmentsIfNecessary(row.doc, opts, txn); - }; + if (parts.length === 1) { + return [s, s]; } + return null; +} - function allDocsInner(winningRev$$1, metadata) { - var row = { - id: metadata.id, - key: metadata.id, - value: { - rev: winningRev$$1 - } - }; - var deleted = metadata.deleted; - if (deleted) { - if (keys) { - results.push(row); - // deleted docs are okay with "keys" requests - row.value.deleted = true; - row.doc = null; - } - } else if (skip-- <= 0) { - results.push(row); - if (opts.include_docs) { - fetchDocAsynchronously(metadata, row, winningRev$$1); - } - } - } +function normalizeDesignDocFunctionName(s) { + var normalized = parseDesignDocFunctionName(s); + return normalized ? normalized.join('/') : null; +} - function processBatch(batchValues) { - for (var i = 0, len = batchValues.length; i < len; i++) { - if (results.length === limit) { - break; - } - var batchValue = batchValues[i]; - if (batchValue.error && keys) { - // key was not found with "keys" requests - results.push(batchValue); - continue; - } - var metadata = decodeMetadata(batchValue); - var winningRev$$1 = metadata.winningRev; - allDocsInner(winningRev$$1, metadata); - } - } +// originally parseUri 1.2.2, now patched by us +// (c) Steven Levithan +// MIT License +var keys = ["source", "protocol", "authority", "userInfo", "user", "password", + "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; +var qName ="queryKey"; +var qParser = /(?:^|&)([^&=]*)=?([^&]*)/g; - function onBatch(batchKeys, batchValues, cursor) { - if (!cursor) { - return; - } - processBatch(batchValues); - if (results.length < limit) { - cursor.continue(); - } - } +// use the "loose" parser +/* eslint maxlen: 0, no-useless-escape: 0 */ +var parser = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; - function onGetAll(e) { - var values = e.target.result; - if (opts.descending) { - values = values.reverse(); - } - processBatch(values); - } +function parseUri(str) { + var m = parser.exec(str); + var uri = {}; + var i = 14; - function onResultsReady() { - var returnVal = { - total_rows: docCount, - offset: opts.skip, - rows: results - }; - - /* istanbul ignore if */ - if (opts.update_seq && updateSeq !== undefined) { - returnVal.update_seq = updateSeq; - } - callback(null, returnVal); + while (i--) { + var key = keys[i]; + var value = m[i] || ""; + var encoded = ['user', 'password'].indexOf(key) !== -1; + uri[key] = encoded ? decodeURIComponent(value) : value; } - function onTxnComplete() { - if (opts.attachments) { - postProcessAttachments(results, opts.binary).then(onResultsReady); - } else { - onResultsReady(); + uri[qName] = {}; + uri[keys[12]].replace(qParser, function ($0, $1, $2) { + if ($1) { + uri[qName][$1] = $2; } - } + }); - // don't bother doing any requests if start > end or limit === 0 - if (keyRangeError || limit === 0) { - return; - } - if (keys) { - return allDocsKeys(opts.keys, docStore, onBatch); - } - if (limit === -1) { // just fetch everything - return getAll(docStore, keyRange, onGetAll); + return uri; +} + +// Based on https://github.com/alexdavid/scope-eval v0.0.3 +// (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js) +// This is basically just a wrapper around new Function() + +function scopeEval(source, scope) { + var keys = []; + var values = []; + for (var key in scope) { + if (scope.hasOwnProperty(key)) { + keys.push(key); + values.push(scope[key]); + } } - // else do a cursor - // choose a batch size based on the skip, since we'll need to skip that many - runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch); + keys.push(source); + return Function.apply(null, keys).apply(null, values); } -// -// Blobs are not supported in all versions of IndexedDB, notably -// Chrome <37 and Android <5. In those versions, storing a blob will throw. -// -// Various other blob bugs exist in Chrome v37-42 (inclusive). -// Detecting them is expensive and confusing to users, and Chrome 37-42 -// is at very low usage worldwide, so we do a hacky userAgent check instead. -// -// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120 -// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916 -// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836 -// -function checkBlobSupport(txn) { - return new Promise(function (resolve) { - var blob$$1 = pouchdbBinaryUtils.blob(['']); - var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob$$1, 'key'); +// this is essentially the "update sugar" function from daleharvey/pouchdb#1388 +// the diffFun tells us what delta to apply to the doc. it either returns +// the doc, or false if it doesn't need to do an update after all +function upsert(db, docId, diffFun) { + return new Promise(function (fulfill, reject) { + db.get(docId, function (err, doc) { + if (err) { + /* istanbul ignore next */ + if (err.status !== 404) { + return reject(err); + } + doc = {}; + } - req.onsuccess = function () { - var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); - var matchedEdge = navigator.userAgent.match(/Edge\//); - // MS Edge pretends to be Chrome 42: - // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx - resolve(matchedEdge || !matchedChrome || - parseInt(matchedChrome[1], 10) >= 43); - }; + // the user might change the _rev, so save it for posterity + var docRev = doc._rev; + var newDoc = diffFun(doc); - txn.onabort = function (e) { - // If the transaction aborts now its due to not being able to - // write to the database, likely due to the disk being full - e.preventDefault(); - e.stopPropagation(); - resolve(false); - }; - }).catch(function () { - return false; // error, so assume unsupported + if (!newDoc) { + // if the diffFun returns falsy, we short-circuit as + // an optimization + return fulfill({updated: false, rev: docRev}); + } + + // users aren't allowed to modify these values, + // so reset them here + newDoc._id = docId; + newDoc._rev = docRev; + fulfill(tryAndPut(db, newDoc, diffFun)); + }); }); } -function countDocs(txn, cb) { - var index = txn.objectStore(DOC_STORE).index('deletedOrLocal'); - index.count(IDBKeyRange.only('0')).onsuccess = function (e) { - cb(e.target.result); - }; +function tryAndPut(db, doc, diffFun) { + return db.put(doc).then(function (res) { + return { + updated: true, + rev: res.rev + }; + }, function (err) { + /* istanbul ignore next */ + if (err.status !== 409) { + throw err; + } + return upsert(db, doc._id, diffFun); + }); } -// This task queue ensures that IDB open calls are done in their own tick -// and sequentially - i.e. we wait for the async IDB open to *fully* complete -// before calling the next one. This works around IE/Edge race conditions in IDB. +function rev() { + return uuidV4.v4().replace(/-/g, '').toLowerCase(); +} -var running = false; -var queue = []; +var uuid = uuidV4.v4; -function tryCode(fun, err, res, PouchDB) { - try { - fun(err, res); - } catch (err) { - // Shouldn't happen, but in some odd cases - // IndexedDB implementations might throw a sync - // error, in which case this will at least log it. - PouchDB.emit('error', err); - } -} +exports.adapterFun = adapterFun; +exports.assign = assign$1; +exports.bulkGetShim = bulkGet; +exports.changesHandler = Changes; +exports.clone = clone; +exports.defaultBackOff = defaultBackOff; +exports.explainError = explainError; +exports.filterChange = filterChange; +exports.flatten = flatten; +exports.functionName = res$1; +exports.guardedConsole = guardedConsole; +exports.hasLocalStorage = hasLocalStorage; +exports.invalidIdError = invalidIdError; +exports.isChromeApp = isChromeApp; +exports.isCordova = isCordova; +exports.isRemote = isRemote; +exports.listenerCount = listenerCount; +exports.nextTick = immediate; +exports.normalizeDdocFunctionName = normalizeDesignDocFunctionName; +exports.once = once; +exports.parseDdocFunctionName = parseDesignDocFunctionName; +exports.parseUri = parseUri; +exports.pick = pick; +exports.rev = rev; +exports.scopeEval = scopeEval; +exports.toPromise = toPromise; +exports.upsert = upsert; +exports.uuid = uuid; -function applyNext() { - if (running || !queue.length) { - return; - } - running = true; - queue.shift()(); -} +},{"argsarray":39,"events":491,"immediate":505,"inherits":495,"pouchdb-collections":508,"pouchdb-errors":509,"pouchdb-promise":510,"uuid":512}],512:[function(require,module,exports){ +var v1 = require('./v1'); +var v4 = require('./v4'); -function enqueueTask(action, callback, PouchDB) { - queue.push(function runAction() { - action(function runCallback(err, res) { - tryCode(callback, err, res, PouchDB); - running = false; - pouchdbUtils.nextTick(function runNext() { - applyNext(PouchDB); - }); - }); - }); - applyNext(); -} +var uuid = v4; +uuid.v1 = v1; +uuid.v4 = v4; -function changes(opts, api, dbName, idb) { - opts = pouchdbUtils.clone(opts); +module.exports = uuid; - if (opts.continuous) { - var id = dbName + ':' + pouchdbUtils.uuid(); - changesHandler$1.addListener(dbName, id, api, opts); - changesHandler$1.notify(dbName); - return { - cancel: function () { - changesHandler$1.removeListener(dbName, id); - } - }; - } +},{"./v1":515,"./v4":516}],513:[function(require,module,exports){ +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} - var docIds = opts.doc_ids && new pouchdbCollections.Set(opts.doc_ids); +function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; +} - opts.since = opts.since || 0; - var lastSeq = opts.since; +module.exports = bytesToUuid; - var limit = 'limit' in opts ? opts.limit : -1; - if (limit === 0) { - limit = 1; // per CouchDB _changes spec - } - var returnDocs; - if ('return_docs' in opts) { - returnDocs = opts.return_docs; - } else if ('returnDocs' in opts) { - // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release - returnDocs = opts.returnDocs; - } else { - returnDocs = true; - } +},{}],514:[function(require,module,exports){ +// Unique ID creation requires a high quality random # generator. In the +// browser this is a little complicated due to unknown quality of Math.random() +// and inconsistent support for the `crypto` API. We do the best we can via +// feature-detection - var results = []; - var numResults = 0; - var filter = pouchdbUtils.filterChange(opts); - var docIdsToMetadata = new pouchdbCollections.Map(); +// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. +var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) || + (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto)); +if (getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef - var txn; - var bySeqStore; - var docStore; - var docIdRevIndex; + module.exports = function whatwgRNG() { + getRandomValues(rnds8); + return rnds8; + }; +} else { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var rnds = new Array(16); - function onBatch(batchKeys, batchValues, cursor) { - if (!cursor || !batchKeys.length) { // done - return; + module.exports = function mathRNG() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; } - var winningDocs = new Array(batchKeys.length); - var metadatas = new Array(batchKeys.length); + return rnds; + }; +} - function processMetadataAndWinningDoc(metadata, winningDoc) { - var change = opts.processChange(winningDoc, metadata, opts); - lastSeq = change.seq = metadata.seq; +},{}],515:[function(require,module,exports){ +var rng = require('./lib/rng'); +var bytesToUuid = require('./lib/bytesToUuid'); - var filtered = filter(change); - if (typeof filtered === 'object') { // anything but true/false indicates error - return opts.complete(filtered); - } +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html - if (filtered) { - numResults++; - if (returnDocs) { - results.push(change); - } - // process the attachment immediately - // for the benefit of live listeners - if (opts.attachments && opts.include_docs) { - fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () { - postProcessAttachments([change], opts.binary).then(function () { - opts.onChange(change); - }); - }); - } else { - opts.onChange(change); - } - } - } +var _nodeId; +var _clockseq; - function onBatchDone() { - for (var i = 0, len = winningDocs.length; i < len; i++) { - if (numResults === limit) { - break; - } - var winningDoc = winningDocs[i]; - if (!winningDoc) { - continue; - } - var metadata = metadatas[i]; - processMetadataAndWinningDoc(metadata, winningDoc); - } +// Previous uuid creation time +var _lastMSecs = 0; +var _lastNSecs = 0; - if (numResults !== limit) { - cursor.continue(); - } - } +// See https://github.com/broofa/node-uuid for API details +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; - // Fetch all metadatas/winningdocs from this batch in parallel, then process - // them all only once all data has been collected. This is done in parallel - // because it's faster than doing it one-at-a-time. - var numDone = 0; - batchValues.forEach(function (value, i) { - var doc = decodeDoc(value); - var seq = batchKeys[i]; - fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) { - metadatas[i] = metadata; - winningDocs[i] = winningDoc; - if (++numDone === batchKeys.length) { - onBatchDone(); - } - }); - }); - } + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - function onGetMetadata(doc, seq, metadata, cb) { - if (metadata.seq !== seq) { - // some other seq is later - return cb(); + // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + if (node == null || clockseq == null) { + var seedBytes = rng(); + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] + ]; } - - if (metadata.winningRev === doc._rev) { - // this is the winning doc - return cb(metadata, doc); + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } - - // fetch winning doc in separate request - var docIdRev = doc._id + '::' + metadata.winningRev; - var req = docIdRevIndex.get(docIdRev); - req.onsuccess = function (e) { - cb(metadata, decodeDoc(e.target.result)); - }; } - function fetchWinningDocAndMetadata(doc, seq, cb) { - if (docIds && !docIds.has(doc._id)) { - return cb(); - } + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - var metadata = docIdsToMetadata.get(doc._id); - if (metadata) { // cached - return onGetMetadata(doc, seq, metadata, cb); - } - // metadata not cached, have to go fetch it - docStore.get(doc._id).onsuccess = function (e) { - metadata = decodeMetadata(e.target.result); - docIdsToMetadata.set(doc._id, metadata); - onGetMetadata(doc, seq, metadata, cb); - }; - } + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - function finish() { - opts.complete(null, { - results: results, - last_seq: lastSeq - }); - } + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - function onTxnComplete() { - if (!opts.continuous && opts.attachments) { - // cannot guarantee that postProcessing was already done, - // so do it again - postProcessAttachments(results).then(finish); - } else { - finish(); - } + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; } - var objectStores = [DOC_STORE, BY_SEQ_STORE]; - if (opts.attachments) { - objectStores.push(ATTACH_STORE); + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; } - var txnResult = openTransactionSafely(idb, objectStores, 'readonly'); - if (txnResult.error) { - return opts.complete(txnResult.error); + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } - txn = txnResult.txn; - txn.onabort = idbError(opts.complete); - txn.oncomplete = onTxnComplete; - bySeqStore = txn.objectStore(BY_SEQ_STORE); - docStore = txn.objectStore(DOC_STORE); - docIdRevIndex = bySeqStore.index('_doc_id_rev'); + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; - var keyRange = (opts.since && !opts.descending) ? - IDBKeyRange.lowerBound(opts.since, true) : null; + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; - runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch); -} + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; -var cachedDBs = new pouchdbCollections.Map(); -var blobSupportPromise; -var openReqList = new pouchdbCollections.Map(); + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; -function IdbPouch(opts, callback) { - var api = this; + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; - enqueueTask(function (thisCallback) { - init(api, opts, thisCallback); - }, callback, api.constructor); -} + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; -function init(api, opts, callback) { + // `clock_seq_low` + b[i++] = clockseq & 0xff; - var dbName = opts.name; + // `node` + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } - var idb = null; - api._meta = null; + return buf ? buf : bytesToUuid(b); +} - // called when creating a fresh new database - function createSchema(db) { - var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'}); - db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true}) - .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); - db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'}); - db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false}); - db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); +module.exports = v1; - // added in v2 - docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); +},{"./lib/bytesToUuid":513,"./lib/rng":514}],516:[function(require,module,exports){ +var rng = require('./lib/rng'); +var bytesToUuid = require('./lib/bytesToUuid'); - // added in v3 - db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}); +function v4(options, buf, offset) { + var i = buf && offset || 0; - // added in v4 - var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, - {autoIncrement: true}); - attAndSeqStore.createIndex('seq', 'seq'); - attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; } + options = options || {}; - // migration to version 2 - // unfortunately "deletedOrLocal" is a misnomer now that we no longer - // store local docs in the main doc-store, but whaddyagonnado - function addDeletedOrLocalIndex(txn, callback) { - var docStore = txn.objectStore(DOC_STORE); - docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); + var rnds = options.random || (options.rng || rng)(); - docStore.openCursor().onsuccess = function (event) { - var cursor = event.target.result; - if (cursor) { - var metadata = cursor.value; - var deleted = pouchdbMerge.isDeleted(metadata); - metadata.deletedOrLocal = deleted ? "1" : "0"; - docStore.put(metadata); - cursor.continue(); - } else { - callback(); - } - }; - } + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; - // migration to version 3 (part 1) - function createLocalStoreSchema(db) { - db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}) - .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } } - // migration to version 3 (part 2) - function migrateLocalStore(txn, cb) { - var localStore = txn.objectStore(LOCAL_STORE); - var docStore = txn.objectStore(DOC_STORE); - var seqStore = txn.objectStore(BY_SEQ_STORE); + return buf || bytesToUuid(rnds); +} - var cursor = docStore.openCursor(); - cursor.onsuccess = function (event) { - var cursor = event.target.result; - if (cursor) { - var metadata = cursor.value; - var docId = metadata.id; - var local = pouchdbMerge.isLocalId(docId); - var rev = pouchdbMerge.winningRev(metadata); - if (local) { - var docIdRev = docId + "::" + rev; - // remove all seq entries - // associated with this docId - var start = docId + "::"; - var end = docId + "::~"; - var index = seqStore.index('_doc_id_rev'); - var range = IDBKeyRange.bound(start, end, false, false); - var seqCursor = index.openCursor(range); - seqCursor.onsuccess = function (e) { - seqCursor = e.target.result; - if (!seqCursor) { - // done - docStore.delete(cursor.primaryKey); - cursor.continue(); - } else { - var data = seqCursor.value; - if (data._doc_id_rev === docIdRev) { - localStore.put(data); - } - seqStore.delete(seqCursor.primaryKey); - seqCursor.continue(); - } - }; - } else { - cursor.continue(); - } - } else if (cb) { - cb(); - } - }; - } +module.exports = v4; - // migration to version 4 (part 1) - function addAttachAndSeqStore(db) { - var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, - {autoIncrement: true}); - attAndSeqStore.createIndex('seq', 'seq'); - attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); - } +},{"./lib/bytesToUuid":513,"./lib/rng":514}],517:[function(require,module,exports){ +'use strict'; - // migration to version 4 (part 2) - function migrateAttsAndSeqs(txn, callback) { - var seqStore = txn.objectStore(BY_SEQ_STORE); - var attStore = txn.objectStore(ATTACH_STORE); - var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - // need to actually populate the table. this is the expensive part, - // so as an optimization, check first that this database even - // contains attachments - var req = attStore.count(); - req.onsuccess = function (e) { - var count = e.target.result; - if (!count) { - return callback(); // done - } +var pouchdbUtils = require('pouchdb-utils'); +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbErrors = require('pouchdb-errors'); +var pouchdbJson = require('pouchdb-json'); +var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var pouchdbCollections = require('pouchdb-collections'); +var pouchdbAdapterUtils = require('pouchdb-adapter-utils'); +var pouchdbMerge = require('pouchdb-merge'); - seqStore.openCursor().onsuccess = function (e) { - var cursor = e.target.result; - if (!cursor) { - return callback(); // done - } - var doc = cursor.value; - var seq = cursor.primaryKey; - var atts = Object.keys(doc._attachments || {}); - var digestMap = {}; - for (var j = 0; j < atts.length; j++) { - var att = doc._attachments[atts[j]]; - digestMap[att.digest] = true; // uniq digests, just in case - } - var digests = Object.keys(digestMap); - for (j = 0; j < digests.length; j++) { - var digest = digests[j]; - attAndSeqStore.put({ - seq: seq, - digestSeq: digest + '::' + seq - }); - } - cursor.continue(); - }; - }; - } +// IndexedDB requires a versioned database structure, so we use the +// version here to manage migrations. +var ADAPTER_VERSION = 5; - // migration to version 5 - // Instead of relying on on-the-fly migration of metadata, - // this brings the doc-store to its modern form: - // - metadata.winningrev - // - metadata.seq - // - stringify the metadata when storing it - function migrateMetadata(txn) { +// The object stores created for each database +// DOC_STORE stores the document meta data, its revision history and state +// Keyed by document id +var DOC_STORE = 'document-store'; +// BY_SEQ_STORE stores a particular version of a document, keyed by its +// sequence id +var BY_SEQ_STORE = 'by-sequence'; +// Where we store attachments +var ATTACH_STORE = 'attach-store'; +// Where we store many-to-many relations +// between attachment digests and seqs +var ATTACH_AND_SEQ_STORE = 'attach-seq-store'; - function decodeMetadataCompat(storedObject) { - if (!storedObject.data) { - // old format, when we didn't store it stringified - storedObject.deleted = storedObject.deletedOrLocal === '1'; - return storedObject; - } - return decodeMetadata(storedObject); - } +// Where we store database-wide meta data in a single record +// keyed by id: META_STORE +var META_STORE = 'meta-store'; +// Where we store local documents +var LOCAL_STORE = 'local-store'; +// Where we detect blob support +var DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support'; - // ensure that every metadata has a winningRev and seq, - // which was previously created on-the-fly but better to migrate - var bySeqStore = txn.objectStore(BY_SEQ_STORE); - var docStore = txn.objectStore(DOC_STORE); - var cursor = docStore.openCursor(); - cursor.onsuccess = function (e) { - var cursor = e.target.result; - if (!cursor) { - return; // done - } - var metadata = decodeMetadataCompat(cursor.value); +function idbError(callback) { + return function (evt) { + var message = 'unknown_error'; + if (evt.target && evt.target.error) { + message = evt.target.error.name || evt.target.error.message; + } + callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, message, evt.type)); + }; +} - metadata.winningRev = metadata.winningRev || - pouchdbMerge.winningRev(metadata); +// Unfortunately, the metadata has to be stringified +// when it is put into the database, because otherwise +// IndexedDB can throw errors for deeply-nested objects. +// Originally we just used JSON.parse/JSON.stringify; now +// we use this custom vuvuzela library that avoids recursion. +// If we could do it all over again, we'd probably use a +// format for the revision trees other than JSON. +function encodeMetadata(metadata, winningRev, deleted) { + return { + data: pouchdbJson.safeJsonStringify(metadata), + winningRev: winningRev, + deletedOrLocal: deleted ? '1' : '0', + seq: metadata.seq, // highest seq for this doc + id: metadata.id + }; +} - function fetchMetadataSeq() { - // metadata.seq was added post-3.2.0, so if it's missing, - // we need to fetch it manually - var start = metadata.id + '::'; - var end = metadata.id + '::\uffff'; - var req = bySeqStore.index('_doc_id_rev').openCursor( - IDBKeyRange.bound(start, end)); +function decodeMetadata(storedObject) { + if (!storedObject) { + return null; + } + var metadata = pouchdbJson.safeJsonParse(storedObject.data); + metadata.winningRev = storedObject.winningRev; + metadata.deleted = storedObject.deletedOrLocal === '1'; + metadata.seq = storedObject.seq; + return metadata; +} - var metadataSeq = 0; - req.onsuccess = function (e) { - var cursor = e.target.result; - if (!cursor) { - metadata.seq = metadataSeq; - return onGetMetadataSeq(); - } - var seq = cursor.primaryKey; - if (seq > metadataSeq) { - metadataSeq = seq; - } - cursor.continue(); - }; - } +// read the doc back out from the database. we don't store the +// _id or _rev because we already have _doc_id_rev. +function decodeDoc(doc) { + if (!doc) { + return doc; + } + var idx = doc._doc_id_rev.lastIndexOf(':'); + doc._id = doc._doc_id_rev.substring(0, idx - 1); + doc._rev = doc._doc_id_rev.substring(idx + 1); + delete doc._doc_id_rev; + return doc; +} - function onGetMetadataSeq() { - var metadataToStore = encodeMetadata(metadata, - metadata.winningRev, metadata.deleted); +// Read a blob from the database, encoding as necessary +// and translating from base64 if the IDB doesn't support +// native Blobs +function readBlobData(body, type, asBlob, callback) { + if (asBlob) { + if (!body) { + callback(pouchdbBinaryUtils.blob([''], {type: type})); + } else if (typeof body !== 'string') { // we have blob support + callback(body); + } else { // no blob support + callback(pouchdbBinaryUtils.base64StringToBlobOrBuffer(body, type)); + } + } else { // as base64 string + if (!body) { + callback(''); + } else if (typeof body !== 'string') { // we have blob support + pouchdbBinaryUtils.readAsBinaryString(body, function (binary) { + callback(pouchdbBinaryUtils.btoa(binary)); + }); + } else { // no blob support + callback(body); + } + } +} - var req = docStore.put(metadataToStore); - req.onsuccess = function () { - cursor.continue(); - }; - } +function fetchAttachmentsIfNecessary(doc, opts, txn, cb) { + var attachments = Object.keys(doc._attachments || {}); + if (!attachments.length) { + return cb && cb(); + } + var numDone = 0; - if (metadata.seq) { - return onGetMetadataSeq(); - } + function checkDone() { + if (++numDone === attachments.length && cb) { + cb(); + } + } - fetchMetadataSeq(); + function fetchAttachment(doc, att) { + var attObj = doc._attachments[att]; + var digest = attObj.digest; + var req = txn.objectStore(ATTACH_STORE).get(digest); + req.onsuccess = function (e) { + attObj.body = e.target.result.body; + checkDone(); }; - } - api._remote = false; - api.type = function () { - return 'idb'; - }; - - api._id = pouchdbUtils.toPromise(function (callback) { - callback(null, api._meta.instanceId); + attachments.forEach(function (att) { + if (opts.attachments && opts.include_docs) { + fetchAttachment(doc, att); + } else { + doc._attachments[att].stub = true; + checkDone(); + } }); +} - api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) { - idbBulkDocs(opts, req, reqOpts, api, idb, callback); - }; - - // First we look up the metadata in the ids database, then we fetch the - // current revision(s) from the by sequence store - api._get = function idb_get(id, opts, callback) { - var doc; - var metadata; - var err; - var txn = opts.ctx; - if (!txn) { - var txnResult = openTransactionSafely(idb, - [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); - } - txn = txnResult.txn; +// IDB-specific postprocessing necessary because +// we don't know whether we stored a true Blob or +// a base64-encoded string, and if it's a Blob it +// needs to be read outside of the transaction context +function postProcessAttachments(results, asBlob) { + return Promise.all(results.map(function (row) { + if (row.doc && row.doc._attachments) { + var attNames = Object.keys(row.doc._attachments); + return Promise.all(attNames.map(function (att) { + var attObj = row.doc._attachments[att]; + if (!('body' in attObj)) { // already processed + return; + } + var body = attObj.body; + var type = attObj.content_type; + return new Promise(function (resolve) { + readBlobData(body, type, asBlob, function (data) { + row.doc._attachments[att] = pouchdbUtils.assign( + pouchdbUtils.pick(attObj, ['digest', 'content_type']), + {data: data} + ); + resolve(); + }); + }); + })); } + })); +} - function finish() { - callback(err, {doc: doc, metadata: metadata, ctx: txn}); - } +function compactRevs(revs, docId, txn) { - txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) { - metadata = decodeMetadata(e.target.result); - // we can determine the result here if: - // 1. there is no such document - // 2. the document is deleted and we don't ask about specific rev - // When we ask with opts.rev we expect the answer to be either - // doc (possibly with _deleted=true) or missing error - if (!metadata) { - err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'missing'); - return finish(); - } - - var rev; - if (!opts.rev) { - rev = metadata.winningRev; - var deleted = pouchdbMerge.isDeleted(metadata); - if (deleted) { - err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, "deleted"); - return finish(); - } - } else { - rev = opts.latest ? pouchdbMerge.latest(opts.rev, metadata) : opts.rev; - } + var possiblyOrphanedDigests = []; + var seqStore = txn.objectStore(BY_SEQ_STORE); + var attStore = txn.objectStore(ATTACH_STORE); + var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); + var count = revs.length; - var objectStore = txn.objectStore(BY_SEQ_STORE); - var key = metadata.id + '::' + rev; + function checkDone() { + count--; + if (!count) { // done processing all revs + deleteOrphanedAttachments(); + } + } - objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) { - doc = e.target.result; - if (doc) { - doc = decodeDoc(doc); - } - if (!doc) { - err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'missing'); - return finish(); + function deleteOrphanedAttachments() { + if (!possiblyOrphanedDigests.length) { + return; + } + possiblyOrphanedDigests.forEach(function (digest) { + var countReq = attAndSeqStore.index('digestSeq').count( + IDBKeyRange.bound( + digest + '::', digest + '::\uffff', false, false)); + countReq.onsuccess = function (e) { + var count = e.target.result; + if (!count) { + // orphaned + attStore.delete(digest); } - finish(); }; - }; - }; + }); + } - api._getAttachment = function (docId, attachId, attachment, opts, callback) { - var txn; - if (opts.ctx) { - txn = opts.ctx; - } else { - var txnResult = openTransactionSafely(idb, - [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); + revs.forEach(function (rev) { + var index = seqStore.index('_doc_id_rev'); + var key = docId + "::" + rev; + index.getKey(key).onsuccess = function (e) { + var seq = e.target.result; + if (typeof seq !== 'number') { + return checkDone(); } - txn = txnResult.txn; - } - var digest = attachment.digest; - var type = attachment.content_type; + seqStore.delete(seq); - txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) { - var body = e.target.result.body; - readBlobData(body, type, opts.binary, function (blobData) { - callback(null, blobData); - }); - }; - }; + var cursor = attAndSeqStore.index('seq') + .openCursor(IDBKeyRange.only(seq)); - api._info = function idb_info(callback) { - var updateSeq; - var docCount; + cursor.onsuccess = function (event) { + var cursor = event.target.result; + if (cursor) { + var digest = cursor.value.digestSeq.split('::')[0]; + possiblyOrphanedDigests.push(digest); + attAndSeqStore.delete(cursor.primaryKey); + cursor.continue(); + } else { // done + checkDone(); + } + }; + }; + }); +} - var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); - } - var txn = txnResult.txn; - txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { - docCount = e.target.result.docCount; +function openTransactionSafely(idb, stores, mode) { + try { + return { + txn: idb.transaction(stores, mode) }; - txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) { - var cursor = e.target.result; - updateSeq = cursor ? cursor.key : 0; + } catch (err) { + return { + error: err }; + } +} - txn.oncomplete = function () { - callback(null, { - doc_count: docCount, - update_seq: updateSeq, - // for debugging - idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64') - }); - }; - }; +var changesHandler = new pouchdbUtils.changesHandler(); - api._allDocs = function idb_allDocs(opts, callback) { - idbAllDocs(opts, idb, callback); - }; +function idbBulkDocs(dbOpts, req, opts, api, idb, callback) { + var docInfos = req.docs; + var txn; + var docStore; + var bySeqStore; + var attachStore; + var attachAndSeqStore; + var metaStore; + var docInfoError; + var metaDoc; - api._changes = function idbChanges(opts) { - return changes(opts, api, dbName, idb); - }; + for (var i = 0, len = docInfos.length; i < len; i++) { + var doc = docInfos[i]; + if (doc._id && pouchdbAdapterUtils.isLocalId(doc._id)) { + continue; + } + doc = docInfos[i] = pouchdbAdapterUtils.parseDoc(doc, opts.new_edits); + if (doc.error && !docInfoError) { + docInfoError = doc; + } + } - api._close = function (callback) { - // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close - // "Returns immediately and closes the connection in a separate thread..." - idb.close(); - cachedDBs.delete(dbName); - callback(); - }; + if (docInfoError) { + return callback(docInfoError); + } - api._getRevisionTree = function (docId, callback) { - var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); + var allDocsProcessed = false; + var docCountDelta = 0; + var results = new Array(docInfos.length); + var fetchedDocs = new pouchdbCollections.Map(); + var preconditionErrored = false; + var blobType = api._meta.blobSupport ? 'blob' : 'base64'; + + pouchdbAdapterUtils.preprocessAttachments(docInfos, blobType, function (err) { + if (err) { + return callback(err); } - var txn = txnResult.txn; - var req = txn.objectStore(DOC_STORE).get(docId); - req.onsuccess = function (event) { - var doc = decodeMetadata(event.target.result); - if (!doc) { - callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); - } else { - callback(null, doc.rev_tree); - } - }; - }; + startTransaction(); + }); + + function startTransaction() { - // This function removes revisions of document docId - // which are listed in revs and sets this document - // revision to to rev_tree - api._doCompaction = function (docId, revs, callback) { var stores = [ - DOC_STORE, - BY_SEQ_STORE, + DOC_STORE, BY_SEQ_STORE, ATTACH_STORE, - ATTACH_AND_SEQ_STORE + LOCAL_STORE, ATTACH_AND_SEQ_STORE, + META_STORE ]; var txnResult = openTransactionSafely(idb, stores, 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } - var txn = txnResult.txn; - - var docStore = txn.objectStore(DOC_STORE); - - docStore.get(docId).onsuccess = function (event) { - var metadata = decodeMetadata(event.target.result); - pouchdbMerge.traverseRevTree(metadata.rev_tree, function (isLeaf, pos, - revHash, ctx, opts) { - var rev = pos + '-' + revHash; - if (revs.indexOf(rev) !== -1) { - opts.status = 'missing'; - } - }); - compactRevs(revs, docId, txn); - var winningRev$$1 = metadata.winningRev; - var deleted = metadata.deleted; - txn.objectStore(DOC_STORE).put( - encodeMetadata(metadata, winningRev$$1, deleted)); - }; + txn = txnResult.txn; txn.onabort = idbError(callback); - txn.oncomplete = function () { - callback(); + txn.ontimeout = idbError(callback); + txn.oncomplete = complete; + docStore = txn.objectStore(DOC_STORE); + bySeqStore = txn.objectStore(BY_SEQ_STORE); + attachStore = txn.objectStore(ATTACH_STORE); + attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); + metaStore = txn.objectStore(META_STORE); + + metaStore.get(META_STORE).onsuccess = function (e) { + metaDoc = e.target.result; + updateDocCountIfReady(); }; - }; + verifyAttachments(function (err) { + if (err) { + preconditionErrored = true; + return callback(err); + } + fetchExistingDocs(); + }); + } - api._getLocal = function (id, callback) { - var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly'); - if (txnResult.error) { - return callback(txnResult.error); - } - var tx = txnResult.txn; - var req = tx.objectStore(LOCAL_STORE).get(id); + function onAllDocsProcessed() { + allDocsProcessed = true; + updateDocCountIfReady(); + } - req.onerror = idbError(callback); - req.onsuccess = function (e) { - var doc = e.target.result; - if (!doc) { - callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); - } else { - delete doc['_doc_id_rev']; // for backwards compat - callback(null, doc); - } - }; - }; + function idbProcessDocs() { + pouchdbAdapterUtils.processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, + txn, results, writeDoc, opts, onAllDocsProcessed); + } - api._putLocal = function (doc, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; + function updateDocCountIfReady() { + if (!metaDoc || !allDocsProcessed) { + return; } - delete doc._revisions; // ignore this, trust the rev - var oldRev = doc._rev; - var id = doc._id; - if (!oldRev) { - doc._rev = '0-1'; - } else { - doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1); + // caching the docCount saves a lot of time in allDocs() and + // info(), which is why we go to all the trouble of doing this + metaDoc.docCount += docCountDelta; + metaStore.put(metaDoc); + } + + function fetchExistingDocs() { + + if (!docInfos.length) { + return; } - var tx = opts.ctx; - var ret; - if (!tx) { - var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); - if (txnResult.error) { - return callback(txnResult.error); + var numFetched = 0; + + function checkDone() { + if (++numFetched === docInfos.length) { + idbProcessDocs(); } - tx = txnResult.txn; - tx.onerror = idbError(callback); - tx.oncomplete = function () { - if (ret) { - callback(null, ret); - } - }; } - var oStore = tx.objectStore(LOCAL_STORE); - var req; - if (oldRev) { - req = oStore.get(id); - req.onsuccess = function (e) { - var oldDoc = e.target.result; - if (!oldDoc || oldDoc._rev !== oldRev) { - callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); - } else { // update - var req = oStore.put(doc); - req.onsuccess = function () { - ret = {ok: true, id: doc._id, rev: doc._rev}; - if (opts.ctx) { // return immediately - callback(null, ret); - } - }; - } - }; - } else { // new doc - req = oStore.add(doc); - req.onerror = function (e) { - // constraint error, already exists - callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); - e.preventDefault(); // avoid transaction abort - e.stopPropagation(); // avoid transaction onerror - }; - req.onsuccess = function () { - ret = {ok: true, id: doc._id, rev: doc._rev}; - if (opts.ctx) { // return immediately - callback(null, ret); - } - }; - } - }; + function readMetadata(event) { + var metadata = decodeMetadata(event.target.result); - api._removeLocal = function (doc, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - var tx = opts.ctx; - if (!tx) { - var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); - if (txnResult.error) { - return callback(txnResult.error); + if (metadata) { + fetchedDocs.set(metadata.id, metadata); } - tx = txnResult.txn; - tx.oncomplete = function () { - if (ret) { - callback(null, ret); - } - }; + checkDone(); } - var ret; - var id = doc._id; - var oStore = tx.objectStore(LOCAL_STORE); - var req = oStore.get(id); - req.onerror = idbError(callback); - req.onsuccess = function (e) { - var oldDoc = e.target.result; - if (!oldDoc || oldDoc._rev !== doc._rev) { - callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); - } else { - oStore.delete(id); - ret = {ok: true, id: id, rev: '0-0'}; - if (opts.ctx) { // return immediately - callback(null, ret); - } + for (var i = 0, len = docInfos.length; i < len; i++) { + var docInfo = docInfos[i]; + if (docInfo._id && pouchdbAdapterUtils.isLocalId(docInfo._id)) { + checkDone(); // skip local docs + continue; } - }; - }; - - api._destroy = function (opts, callback) { - changesHandler$1.removeAllListeners(dbName); + var req = docStore.get(docInfo.metadata.id); + req.onsuccess = readMetadata; + } + } - //Close open request for "dbName" database to fix ie delay. - var openReq = openReqList.get(dbName); - if (openReq && openReq.result) { - openReq.result.close(); - cachedDBs.delete(dbName); + function complete() { + if (preconditionErrored) { + return; } - var req = indexedDB.deleteDatabase(dbName); - req.onsuccess = function () { - //Remove open request from the list. - openReqList.delete(dbName); - if (pouchdbUtils.hasLocalStorage() && (dbName in localStorage)) { - delete localStorage[dbName]; + changesHandler.notify(api._meta.name); + callback(null, results); + } + + function verifyAttachment(digest, callback) { + + var req = attachStore.get(digest); + req.onsuccess = function (e) { + if (!e.target.result) { + var err = pouchdbErrors.createError(pouchdbErrors.MISSING_STUB, + 'unknown stub attachment with digest ' + + digest); + err.status = 412; + callback(err); + } else { + callback(); } - callback(null, { 'ok': true }); }; + } - req.onerror = idbError(callback); - }; + function verifyAttachments(finish) { - var cached = cachedDBs.get(dbName); - if (cached) { - idb = cached.idb; - api._meta = cached.global; - return pouchdbUtils.nextTick(function () { - callback(null, api); + var digests = []; + docInfos.forEach(function (docInfo) { + if (docInfo.data && docInfo.data._attachments) { + Object.keys(docInfo.data._attachments).forEach(function (filename) { + var att = docInfo.data._attachments[filename]; + if (att.stub) { + digests.push(att.digest); + } + }); + } }); - } + if (!digests.length) { + return finish(); + } + var numDone = 0; + var err; - var req; - if (opts.storage) { - req = tryStorageOption(dbName, opts.storage); - } else { - req = indexedDB.open(dbName, ADAPTER_VERSION); + function checkDone() { + if (++numDone === digests.length) { + finish(err); + } + } + digests.forEach(function (digest) { + verifyAttachment(digest, function (attErr) { + if (attErr && !err) { + err = attErr; + } + checkDone(); + }); + }); } - openReqList.set(dbName, req); + function writeDoc(docInfo, winningRev, winningRevIsDeleted, newRevIsDeleted, + isUpdate, delta, resultsIdx, callback) { - req.onupgradeneeded = function (e) { - var db = e.target.result; - if (e.oldVersion < 1) { - return createSchema(db); // new db, initial schema - } - // do migrations + docInfo.metadata.winningRev = winningRev; + docInfo.metadata.deleted = winningRevIsDeleted; - var txn = e.currentTarget.transaction; - // these migrations have to be done in this function, before - // control is returned to the event loop, because IndexedDB + var doc = docInfo.data; + doc._id = docInfo.metadata.id; + doc._rev = docInfo.metadata.rev; - if (e.oldVersion < 3) { - createLocalStoreSchema(db); // v2 -> v3 + if (newRevIsDeleted) { + doc._deleted = true; } - if (e.oldVersion < 4) { - addAttachAndSeqStore(db); // v3 -> v4 + + var hasAttachments = doc._attachments && + Object.keys(doc._attachments).length; + if (hasAttachments) { + return writeAttachments(docInfo, winningRev, winningRevIsDeleted, + isUpdate, resultsIdx, callback); } - var migrations = [ - addDeletedOrLocalIndex, // v1 -> v2 - migrateLocalStore, // v2 -> v3 - migrateAttsAndSeqs, // v3 -> v4 - migrateMetadata // v4 -> v5 - ]; + docCountDelta += delta; + updateDocCountIfReady(); - var i = e.oldVersion; + finishDoc(docInfo, winningRev, winningRevIsDeleted, + isUpdate, resultsIdx, callback); + } - function next() { - var migration = migrations[i - 1]; - i++; - if (migration) { - migration(txn, next); - } - } - - next(); - }; - - req.onsuccess = function (e) { + function finishDoc(docInfo, winningRev, winningRevIsDeleted, + isUpdate, resultsIdx, callback) { - idb = e.target.result; + var doc = docInfo.data; + var metadata = docInfo.metadata; - idb.onversionchange = function () { - idb.close(); - cachedDBs.delete(dbName); - }; + doc._doc_id_rev = metadata.id + '::' + metadata.rev; + delete doc._id; + delete doc._rev; - idb.onabort = function (e) { - pouchdbUtils.guardedConsole('error', 'Database has a global failure', e.target.error); - idb.close(); - cachedDBs.delete(dbName); - }; + function afterPutDoc(e) { + var revsToDelete = docInfo.stemmedRevs || []; - // Do a few setup operations (in parallel as much as possible): - // 1. Fetch meta doc - // 2. Check blob support - // 3. Calculate docCount - // 4. Generate an instanceId if necessary - // 5. Store docCount and instanceId on meta doc + if (isUpdate && api.auto_compaction) { + revsToDelete = revsToDelete.concat(pouchdbMerge.compactTree(docInfo.metadata)); + } - var txn = idb.transaction([ - META_STORE, - DETECT_BLOB_SUPPORT_STORE, - DOC_STORE - ], 'readwrite'); + if (revsToDelete && revsToDelete.length) { + compactRevs(revsToDelete, docInfo.metadata.id, txn); + } - var storedMetaDoc = false; - var metaDoc; - var docCount; - var blobSupport; - var instanceId; + metadata.seq = e.target.result; + // Current _rev is calculated from _rev_tree on read + // delete metadata.rev; + var metadataToStore = encodeMetadata(metadata, winningRev, + winningRevIsDeleted); + var metaDataReq = docStore.put(metadataToStore); + metaDataReq.onsuccess = afterPutMetadata; + } - function completeSetup() { - if (typeof blobSupport === 'undefined' || !storedMetaDoc) { - return; - } - api._meta = { - name: dbName, - instanceId: instanceId, - blobSupport: blobSupport + function afterPutDocError(e) { + // ConstraintError, need to update, not put (see #1638 for details) + e.preventDefault(); // avoid transaction abort + e.stopPropagation(); // avoid transaction onerror + var index = bySeqStore.index('_doc_id_rev'); + var getKeyReq = index.getKey(doc._doc_id_rev); + getKeyReq.onsuccess = function (e) { + var putReq = bySeqStore.put(doc, e.target.result); + putReq.onsuccess = afterPutDoc; }; - - cachedDBs.set(dbName, { - idb: idb, - global: api._meta - }); - callback(null, api); } - function storeMetaDocIfReady() { - if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') { - return; - } - var instanceKey = dbName + '_id'; - if (instanceKey in metaDoc) { - instanceId = metaDoc[instanceKey]; - } else { - metaDoc[instanceKey] = instanceId = pouchdbUtils.uuid(); - } - metaDoc.docCount = docCount; - txn.objectStore(META_STORE).put(metaDoc); + function afterPutMetadata() { + results[resultsIdx] = { + ok: true, + id: metadata.id, + rev: metadata.rev + }; + fetchedDocs.set(docInfo.metadata.id, docInfo.metadata); + insertAttachmentMappings(docInfo, metadata.seq, callback); } - // - // fetch or generate the instanceId - // - txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { - metaDoc = e.target.result || { id: META_STORE }; - storeMetaDocIfReady(); - }; + var putReq = bySeqStore.put(doc); - // - // countDocs - // - countDocs(txn, function (count) { - docCount = count; - storeMetaDocIfReady(); - }); + putReq.onsuccess = afterPutDoc; + putReq.onerror = afterPutDocError; + } - // - // check blob support - // - if (!blobSupportPromise) { - // make sure blob support is only checked once - blobSupportPromise = checkBlobSupport(txn); - } + function writeAttachments(docInfo, winningRev, winningRevIsDeleted, + isUpdate, resultsIdx, callback) { - blobSupportPromise.then(function (val) { - blobSupport = val; - completeSetup(); - }); - // only when the metadata put transaction has completed, - // consider the setup done - txn.oncomplete = function () { - storedMetaDoc = true; - completeSetup(); - }; - }; + var doc = docInfo.data; - req.onerror = function () { - var msg = 'Failed to open indexedDB, are you in private browsing mode?'; - pouchdbUtils.guardedConsole('error', msg); - callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, msg)); - }; -} + var numDone = 0; + var attachments = Object.keys(doc._attachments); -IdbPouch.valid = function () { - // Issue #2533, we finally gave up on doing bug - // detection instead of browser sniffing. Safari brought us - // to our knees. - var isSafari = typeof openDatabase !== 'undefined' && - /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && - !/Chrome/.test(navigator.userAgent) && - !/BlackBerry/.test(navigator.platform); + function collectResults() { + if (numDone === attachments.length) { + finishDoc(docInfo, winningRev, winningRevIsDeleted, + isUpdate, resultsIdx, callback); + } + } - // On Firefox SecurityError is thrown while referencing indexedDB if cookies - // are not allowed. `typeof indexedDB` also triggers the error. - try { - // some outdated implementations of IDB that appear on Samsung - // and HTC Android devices <4.4 are missing IDBKeyRange - return !isSafari && typeof indexedDB !== 'undefined' && - typeof IDBKeyRange !== 'undefined'; - } catch (e) { - return false; - } -}; + function attachmentSaved() { + numDone++; + collectResults(); + } -function tryStorageOption(dbName, storage) { - try { // option only available in Firefox 26+ - return indexedDB.open(dbName, { - version: ADAPTER_VERSION, - storage: storage + attachments.forEach(function (key) { + var att = docInfo.data._attachments[key]; + if (!att.stub) { + var data = att.data; + delete att.data; + att.revpos = parseInt(winningRev, 10); + var digest = att.digest; + saveAttachment(digest, data, attachmentSaved); + } else { + numDone++; + collectResults(); + } }); - } catch (err) { - return indexedDB.open(dbName, ADAPTER_VERSION); } -} - -function index (PouchDB) { - PouchDB.adapter('idb', IdbPouch, true); -} - -module.exports = index; -},{"pouchdb-adapter-utils":512,"pouchdb-binary-utils":517,"pouchdb-collections":510,"pouchdb-errors":529,"pouchdb-json":534,"pouchdb-merge":538,"pouchdb-promise":511,"pouchdb-utils":542}],510:[function(require,module,exports){ -arguments[4][505][0].apply(exports,arguments) -},{"dup":505}],511:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],512:[function(require,module,exports){ -'use strict'; + // map seqs to attachment digests, which + // we will need later during compaction + function insertAttachmentMappings(docInfo, seq, callback) { -Object.defineProperty(exports, '__esModule', { value: true }); + var attsAdded = 0; + var attsToAdd = Object.keys(docInfo.data._attachments || {}); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + if (!attsToAdd.length) { + return callback(); + } -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbErrors = require('pouchdb-errors'); -var pouchdbMerge = require('pouchdb-merge'); -var pouchdbBinaryUtils = require('pouchdb-binary-utils'); -var pouchdbMd5 = require('pouchdb-md5'); -var pouchdbCollections = require('pouchdb-collections'); + function checkDone() { + if (++attsAdded === attsToAdd.length) { + callback(); + } + } -function allDocsKeysQuery(api, opts) { - var keys = opts.keys; - var finalResults = { - offset: opts.skip - }; - return Promise.all(keys.map(function (key) { - var subOpts = pouchdbUtils.assign({key: key, deleted: 'ok'}, opts); - ['limit', 'skip', 'keys'].forEach(function (optKey) { - delete subOpts[optKey]; - }); - return new Promise(function (resolve, reject) { - api._allDocs(subOpts, function (err, res) { - /* istanbul ignore if */ - if (err) { - return reject(err); - } - /* istanbul ignore if */ - if (opts.update_seq && res.update_seq !== undefined) { - finalResults.update_seq = res.update_seq; - } - finalResults.total_rows = res.total_rows; - resolve(res.rows[0] || {key: key, error: 'not_found'}); + function add(att) { + var digest = docInfo.data._attachments[att].digest; + var req = attachAndSeqStore.put({ + seq: seq, + digestSeq: digest + '::' + seq }); - }); - })).then(function (results) { - finalResults.rows = results; - return finalResults; - }); -} -function toObject(array) { - return array.reduce(function (obj, item) { - obj[item] = true; - return obj; - }, {}); -} -// List of top level reserved words for doc -var reservedWords = toObject([ - '_id', - '_rev', - '_attachments', - '_deleted', - '_revisions', - '_revs_info', - '_conflicts', - '_deleted_conflicts', - '_local_seq', - '_rev_tree', - //replication documents - '_replication_id', - '_replication_state', - '_replication_state_time', - '_replication_state_reason', - '_replication_stats', - // Specific to Couchbase Sync Gateway - '_removed' -]); + req.onsuccess = checkDone; + req.onerror = function (e) { + // this callback is for a constaint error, which we ignore + // because this docid/rev has already been associated with + // the digest (e.g. when new_edits == false) + e.preventDefault(); // avoid transaction abort + e.stopPropagation(); // avoid transaction onerror + checkDone(); + }; + } + for (var i = 0; i < attsToAdd.length; i++) { + add(attsToAdd[i]); // do in parallel + } + } -// List of reserved words that should end up the document -var dataWords = toObject([ - '_attachments', - //replication documents - '_replication_id', - '_replication_state', - '_replication_state_time', - '_replication_state_reason', - '_replication_stats' -]); + function saveAttachment(digest, data, callback) { -function parseRevisionInfo(rev$$1) { - if (!/^\d+-./.test(rev$$1)) { - return pouchdbErrors.createError(pouchdbErrors.INVALID_REV); + + var getKeyReq = attachStore.count(digest); + getKeyReq.onsuccess = function (e) { + var count = e.target.result; + if (count) { + return callback(); // already exists + } + var newAtt = { + digest: digest, + body: data + }; + var putReq = attachStore.put(newAtt); + putReq.onsuccess = callback; + }; } - var idx = rev$$1.indexOf('-'); - var left = rev$$1.substring(0, idx); - var right = rev$$1.substring(idx + 1); - return { - prefix: parseInt(left, 10), - id: right - }; } -function makeRevTreeFromRevisions(revisions, opts) { - var pos = revisions.start - revisions.ids.length + 1; +// Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations +// while falling back to a normal IDBCursor operation on browsers that don't support getAll() or +// getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because +// we're not processing each document one-at-a-time. +function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) { - var revisionIds = revisions.ids; - var ids = [revisionIds[0], opts, []]; + // Bail out of getAll()/getAllKeys() in the following cases: + // 1) either method is unsupported - we need both + // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited, + // not really clear the user wants a batched approach where the entire DB is read into memory, + // perhaps they are filtering on a per-doc basis) + // 3) descending – no real way to do this via getAll()/getAllKeys() - for (var i = 1, len = revisionIds.length; i < len; i++) { - ids = [revisionIds[i], {status: 'missing'}, [ids]]; - } + var useGetAll = typeof objectStore.getAll === 'function' && + typeof objectStore.getAllKeys === 'function' && + batchSize > 1 && !descending; - return [{ - pos: pos, - ids: ids - }]; -} + var keysBatch; + var valuesBatch; + var pseudoCursor; -// Preprocess documents, parse their revisions, assign an id and a -// revision for new writes that are missing them, etc -function parseDoc(doc, newEdits) { + function onGetAll(e) { + valuesBatch = e.target.result; + if (keysBatch) { + onBatch(keysBatch, valuesBatch, pseudoCursor); + } + } - var nRevNum; - var newRevId; - var revInfo; - var opts = {status: 'available'}; - if (doc._deleted) { - opts.deleted = true; + function onGetAllKeys(e) { + keysBatch = e.target.result; + if (valuesBatch) { + onBatch(keysBatch, valuesBatch, pseudoCursor); + } } - if (newEdits) { - if (!doc._id) { - doc._id = pouchdbUtils.uuid(); + function continuePseudoCursor() { + if (!keysBatch.length) { // no more results + return onBatch(); } - newRevId = pouchdbUtils.rev(); - if (doc._rev) { - revInfo = parseRevisionInfo(doc._rev); - if (revInfo.error) { - return revInfo; + // fetch next batch, exclusive start + var lastKey = keysBatch[keysBatch.length - 1]; + var newKeyRange; + if (keyRange && keyRange.upper) { + try { + newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper, + true, keyRange.upperOpen); + } catch (e) { + if (e.name === "DataError" && e.code === 0) { + return onBatch(); // we're done, startkey and endkey are equal + } } - doc._rev_tree = [{ - pos: revInfo.prefix, - ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]] - }]; - nRevNum = revInfo.prefix + 1; } else { - doc._rev_tree = [{ - pos: 1, - ids : [newRevId, opts, []] - }]; - nRevNum = 1; - } - } else { - if (doc._revisions) { - doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts); - nRevNum = doc._revisions.start; - newRevId = doc._revisions.ids[0]; - } - if (!doc._rev_tree) { - revInfo = parseRevisionInfo(doc._rev); - if (revInfo.error) { - return revInfo; - } - nRevNum = revInfo.prefix; - newRevId = revInfo.id; - doc._rev_tree = [{ - pos: nRevNum, - ids: [newRevId, opts, []] - }]; + newKeyRange = IDBKeyRange.lowerBound(lastKey, true); } + keyRange = newKeyRange; + keysBatch = null; + valuesBatch = null; + objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; + objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; } - pouchdbUtils.invalidIdError(doc._id); - - doc._rev = nRevNum + '-' + newRevId; - - var result = {metadata : {}, data : {}}; - for (var key in doc) { - /* istanbul ignore else */ - if (Object.prototype.hasOwnProperty.call(doc, key)) { - var specialKey = key[0] === '_'; - if (specialKey && !reservedWords[key]) { - var error = pouchdbErrors.createError(pouchdbErrors.DOC_VALIDATION, key); - error.message = pouchdbErrors.DOC_VALIDATION.message + ': ' + key; - throw error; - } else if (specialKey && !dataWords[key]) { - result.metadata[key.slice(1)] = doc[key]; - } else { - result.data[key] = doc[key]; - } + function onCursor(e) { + var cursor = e.target.result; + if (!cursor) { // done + return onBatch(); } + // regular IDBCursor acts like a batch where batch size is always 1 + onBatch([cursor.key], [cursor.value], cursor); } - return result; -} -function parseBase64(data) { - try { - return pouchdbBinaryUtils.atob(data); - } catch (e) { - var err = pouchdbErrors.createError(pouchdbErrors.BAD_ARG, - 'Attachment is not a valid base64 string'); - return {error: err}; + if (useGetAll) { + pseudoCursor = {"continue": continuePseudoCursor}; + objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; + objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; + } else if (descending) { + objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor; + } else { + objectStore.openCursor(keyRange).onsuccess = onCursor; } } -function preprocessString(att, blobType, callback) { - var asBinary = parseBase64(att.data); - if (asBinary.error) { - return callback(asBinary.error); +// simple shim for objectStore.getAll(), falling back to IDBCursor +function getAll(objectStore, keyRange, onSuccess) { + if (typeof objectStore.getAll === 'function') { + // use native getAll + objectStore.getAll(keyRange).onsuccess = onSuccess; + return; } + // fall back to cursors + var values = []; - att.length = asBinary.length; - if (blobType === 'blob') { - att.data = pouchdbBinaryUtils.binaryStringToBlobOrBuffer(asBinary, att.content_type); - } else if (blobType === 'base64') { - att.data = pouchdbBinaryUtils.btoa(asBinary); - } else { // binary - att.data = asBinary; + function onCursor(e) { + var cursor = e.target.result; + if (cursor) { + values.push(cursor.value); + cursor.continue(); + } else { + onSuccess({ + target: { + result: values + } + }); + } } - pouchdbMd5.binaryMd5(asBinary, function (result) { - att.digest = 'md5-' + result; - callback(); - }); + + objectStore.openCursor(keyRange).onsuccess = onCursor; } -function preprocessBlob(att, blobType, callback) { - pouchdbMd5.binaryMd5(att.data, function (md5) { - att.digest = 'md5-' + md5; - // size is for blobs (browser), length is for buffers (node) - att.length = att.data.size || att.data.length || 0; - if (blobType === 'binary') { - pouchdbBinaryUtils.blobOrBufferToBinaryString(att.data, function (binString) { - att.data = binString; - callback(); - }); - } else if (blobType === 'base64') { - pouchdbBinaryUtils.blobOrBufferToBase64(att.data, function (b64) { - att.data = b64; - callback(); - }); - } else { - callback(); - } +function allDocsKeys(keys, docStore, onBatch) { + // It's not guaranted to be returned in right order + var valuesBatch = []; + var count = 0; + keys.forEach(function (key, index) { + docStore.get(key).onsuccess = function (event) { + if (event.target.result) { + valuesBatch[index] = event.target.result; + } else { + valuesBatch[index] = {key: key, error: 'not_found'}; + } + count++; + if (count === keys.length) { + onBatch(keys, valuesBatch, {}); + } + }; }); } -function preprocessAttachment(att, blobType, callback) { - if (att.stub) { - return callback(); - } - if (typeof att.data === 'string') { // input is a base64 string - preprocessString(att, blobType, callback); - } else { // input is a blob - preprocessBlob(att, blobType, callback); +function createKeyRange(start, end, inclusiveEnd, key, descending) { + try { + if (start && end) { + if (descending) { + return IDBKeyRange.bound(end, start, !inclusiveEnd, false); + } else { + return IDBKeyRange.bound(start, end, false, !inclusiveEnd); + } + } else if (start) { + if (descending) { + return IDBKeyRange.upperBound(start); + } else { + return IDBKeyRange.lowerBound(start); + } + } else if (end) { + if (descending) { + return IDBKeyRange.lowerBound(end, !inclusiveEnd); + } else { + return IDBKeyRange.upperBound(end, !inclusiveEnd); + } + } else if (key) { + return IDBKeyRange.only(key); + } + } catch (e) { + return {error: e}; } + return null; } -function preprocessAttachments(docInfos, blobType, callback) { +function idbAllDocs(opts, idb, callback) { + var start = 'startkey' in opts ? opts.startkey : false; + var end = 'endkey' in opts ? opts.endkey : false; + var key = 'key' in opts ? opts.key : false; + var keys = 'keys' in opts ? opts.keys : false; + var skip = opts.skip || 0; + var limit = typeof opts.limit === 'number' ? opts.limit : -1; + var inclusiveEnd = opts.inclusive_end !== false; - if (!docInfos.length) { - return callback(); + var keyRange; + var keyRangeError; + if (!keys) { + keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending); + keyRangeError = keyRange && keyRange.error; + if (keyRangeError && + !(keyRangeError.name === "DataError" && keyRangeError.code === 0)) { + // DataError with error code 0 indicates start is less than end, so + // can just do an empty query. Else need to throw + return callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, + keyRangeError.name, keyRangeError.message)); + } } - var docv = 0; - var overallErr; + var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE]; - docInfos.forEach(function (docInfo) { - var attachments = docInfo.data && docInfo.data._attachments ? - Object.keys(docInfo.data._attachments) : []; - var recv = 0; + if (opts.attachments) { + stores.push(ATTACH_STORE); + } + var txnResult = openTransactionSafely(idb, stores, 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); + } + var txn = txnResult.txn; + txn.oncomplete = onTxnComplete; + txn.onabort = idbError(callback); + var docStore = txn.objectStore(DOC_STORE); + var seqStore = txn.objectStore(BY_SEQ_STORE); + var metaStore = txn.objectStore(META_STORE); + var docIdRevIndex = seqStore.index('_doc_id_rev'); + var results = []; + var docCount; + var updateSeq; - if (!attachments.length) { - return done(); - } + metaStore.get(META_STORE).onsuccess = function (e) { + docCount = e.target.result.docCount; + }; - function processedAttachment(err) { - overallErr = err; - recv++; - if (recv === attachments.length) { - done(); + /* istanbul ignore if */ + if (opts.update_seq) { + getMaxUpdateSeq(seqStore, function (e) { + if (e.target.result && e.target.result.length > 0) { + updateSeq = e.target.result[0]; } + }); + } + + function getMaxUpdateSeq(objectStore, onSuccess) { + function onCursor(e) { + var cursor = e.target.result; + var maxKey = undefined; + if (cursor && cursor.key) { + maxKey = cursor.key; + } + return onSuccess({ + target: { + result: [maxKey] + } + }); } + objectStore.openCursor(null, 'prev').onsuccess = onCursor; + } - for (var key in docInfo.data._attachments) { - if (docInfo.data._attachments.hasOwnProperty(key)) { - preprocessAttachment(docInfo.data._attachments[key], - blobType, processedAttachment); + // if the user specifies include_docs=true, then we don't + // want to block the main cursor while we're fetching the doc + function fetchDocAsynchronously(metadata, row, winningRev) { + var key = metadata.id + "::" + winningRev; + docIdRevIndex.get(key).onsuccess = function onGetDoc(e) { + row.doc = decodeDoc(e.target.result); + if (opts.conflicts) { + var conflicts = pouchdbMerge.collectConflicts(metadata); + if (conflicts.length) { + row.doc._conflicts = conflicts; + } } - } - }); + fetchAttachmentsIfNecessary(row.doc, opts, txn); + }; + } - function done() { - docv++; - if (docInfos.length === docv) { - if (overallErr) { - callback(overallErr); - } else { - callback(); + function allDocsInner(winningRev, metadata) { + var row = { + id: metadata.id, + key: metadata.id, + value: { + rev: winningRev + } + }; + var deleted = metadata.deleted; + if (deleted) { + if (keys) { + results.push(row); + // deleted docs are okay with "keys" requests + row.value.deleted = true; + row.doc = null; + } + } else if (skip-- <= 0) { + results.push(row); + if (opts.include_docs) { + fetchDocAsynchronously(metadata, row, winningRev); } } } -} - -function updateDoc(revLimit, prev, docInfo, results, - i, cb, writeDoc, newEdits) { - if (pouchdbMerge.revExists(prev.rev_tree, docInfo.metadata.rev)) { - results[i] = docInfo; - return cb(); + function processBatch(batchValues) { + for (var i = 0, len = batchValues.length; i < len; i++) { + if (results.length === limit) { + break; + } + var batchValue = batchValues[i]; + if (batchValue.error && keys) { + // key was not found with "keys" requests + results.push(batchValue); + continue; + } + var metadata = decodeMetadata(batchValue); + var winningRev = metadata.winningRev; + allDocsInner(winningRev, metadata); + } } - // sometimes this is pre-calculated. historically not always - var previousWinningRev = prev.winningRev || pouchdbMerge.winningRev(prev); - var previouslyDeleted = 'deleted' in prev ? prev.deleted : - pouchdbMerge.isDeleted(prev, previousWinningRev); - var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted : - pouchdbMerge.isDeleted(docInfo.metadata); - var isRoot = /^1-/.test(docInfo.metadata.rev); - - if (previouslyDeleted && !deleted && newEdits && isRoot) { - var newDoc = docInfo.data; - newDoc._rev = previousWinningRev; - newDoc._id = docInfo.metadata.id; - docInfo = parseDoc(newDoc, newEdits); + function onBatch(batchKeys, batchValues, cursor) { + if (!cursor) { + return; + } + processBatch(batchValues); + if (results.length < limit) { + cursor.continue(); + } } - var merged = pouchdbMerge.merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit); - - var inConflict = newEdits && (( - (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') || - (!previouslyDeleted && merged.conflicts !== 'new_leaf') || - (previouslyDeleted && !deleted && merged.conflicts === 'new_branch'))); + function onGetAll(e) { + var values = e.target.result; + if (opts.descending) { + values = values.reverse(); + } + processBatch(values); + } - if (inConflict) { - var err = pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); - results[i] = err; - return cb(); + function onResultsReady() { + var returnVal = { + total_rows: docCount, + offset: opts.skip, + rows: results + }; + + /* istanbul ignore if */ + if (opts.update_seq && updateSeq !== undefined) { + returnVal.update_seq = updateSeq; + } + callback(null, returnVal); } - var newRev = docInfo.metadata.rev; - docInfo.metadata.rev_tree = merged.tree; - docInfo.stemmedRevs = merged.stemmedRevs || []; - /* istanbul ignore else */ - if (prev.rev_map) { - docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb + function onTxnComplete() { + if (opts.attachments) { + postProcessAttachments(results, opts.binary).then(onResultsReady); + } else { + onResultsReady(); + } } - // recalculate - var winningRev$$1 = pouchdbMerge.winningRev(docInfo.metadata); - var winningRevIsDeleted = pouchdbMerge.isDeleted(docInfo.metadata, winningRev$$1); + // don't bother doing any requests if start > end or limit === 0 + if (keyRangeError || limit === 0) { + return; + } + if (keys) { + return allDocsKeys(opts.keys, docStore, onBatch); + } + if (limit === -1) { // just fetch everything + return getAll(docStore, keyRange, onGetAll); + } + // else do a cursor + // choose a batch size based on the skip, since we'll need to skip that many + runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch); +} - // calculate the total number of documents that were added/removed, - // from the perspective of total_rows/doc_count - var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 : - previouslyDeleted < winningRevIsDeleted ? -1 : 1; +// +// Blobs are not supported in all versions of IndexedDB, notably +// Chrome <37 and Android <5. In those versions, storing a blob will throw. +// +// Various other blob bugs exist in Chrome v37-42 (inclusive). +// Detecting them is expensive and confusing to users, and Chrome 37-42 +// is at very low usage worldwide, so we do a hacky userAgent check instead. +// +// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120 +// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916 +// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836 +// +function checkBlobSupport(txn) { + return new Promise(function (resolve) { + var blob = pouchdbBinaryUtils.blob(['']); + var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key'); - var newRevIsDeleted; - if (newRev === winningRev$$1) { - // if the new rev is the same as the winning rev, we can reuse that value - newRevIsDeleted = winningRevIsDeleted; - } else { - // if they're not the same, then we need to recalculate - newRevIsDeleted = pouchdbMerge.isDeleted(docInfo.metadata, newRev); - } + req.onsuccess = function () { + var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); + var matchedEdge = navigator.userAgent.match(/Edge\//); + // MS Edge pretends to be Chrome 42: + // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx + resolve(matchedEdge || !matchedChrome || + parseInt(matchedChrome[1], 10) >= 43); + }; - writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, - true, delta, i, cb); + txn.onabort = function (e) { + // If the transaction aborts now its due to not being able to + // write to the database, likely due to the disk being full + e.preventDefault(); + e.stopPropagation(); + resolve(false); + }; + }).catch(function () { + return false; // error, so assume unsupported + }); } -function rootIsMissing(docInfo) { - return docInfo.metadata.rev_tree[0].ids[1].status === 'missing'; +function countDocs(txn, cb) { + var index = txn.objectStore(DOC_STORE).index('deletedOrLocal'); + index.count(IDBKeyRange.only('0')).onsuccess = function (e) { + cb(e.target.result); + }; } -function processDocs(revLimit, docInfos, api, fetchedDocs, tx, results, - writeDoc, opts, overallCallback) { +// This task queue ensures that IDB open calls are done in their own tick +// and sequentially - i.e. we wait for the async IDB open to *fully* complete +// before calling the next one. This works around IE/Edge race conditions in IDB. - // Default to 1000 locally - revLimit = revLimit || 1000; +var running = false; +var queue = []; - function insertDoc(docInfo, resultsIdx, callback) { - // Cant insert new deleted documents - var winningRev$$1 = pouchdbMerge.winningRev(docInfo.metadata); - var deleted = pouchdbMerge.isDeleted(docInfo.metadata, winningRev$$1); - if ('was_delete' in opts && deleted) { - results[resultsIdx] = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'deleted'); - return callback(); - } +function tryCode(fun, err, res, PouchDB) { + try { + fun(err, res); + } catch (err) { + // Shouldn't happen, but in some odd cases + // IndexedDB implementations might throw a sync + // error, in which case this will at least log it. + PouchDB.emit('error', err); + } +} - // 4712 - detect whether a new document was inserted with a _rev - var inConflict = newEdits && rootIsMissing(docInfo); +function applyNext() { + if (running || !queue.length) { + return; + } + running = true; + queue.shift()(); +} - if (inConflict) { - var err = pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); - results[resultsIdx] = err; - return callback(); - } +function enqueueTask(action, callback, PouchDB) { + queue.push(function runAction() { + action(function runCallback(err, res) { + tryCode(callback, err, res, PouchDB); + running = false; + pouchdbUtils.nextTick(function runNext() { + applyNext(PouchDB); + }); + }); + }); + applyNext(); +} - var delta = deleted ? 0 : 1; +function changes(opts, api, dbName, idb) { + opts = pouchdbUtils.clone(opts); - writeDoc(docInfo, winningRev$$1, deleted, deleted, false, - delta, resultsIdx, callback); + if (opts.continuous) { + var id = dbName + ':' + pouchdbUtils.uuid(); + changesHandler.addListener(dbName, id, api, opts); + changesHandler.notify(dbName); + return { + cancel: function () { + changesHandler.removeListener(dbName, id); + } + }; } - var newEdits = opts.new_edits; - var idsToDocs = new pouchdbCollections.Map(); + var docIds = opts.doc_ids && new pouchdbCollections.Set(opts.doc_ids); - var docsDone = 0; - var docsToDo = docInfos.length; + opts.since = opts.since || 0; + var lastSeq = opts.since; - function checkAllDocsDone() { - if (++docsDone === docsToDo && overallCallback) { - overallCallback(); - } + var limit = 'limit' in opts ? opts.limit : -1; + if (limit === 0) { + limit = 1; // per CouchDB _changes spec + } + var returnDocs; + if ('return_docs' in opts) { + returnDocs = opts.return_docs; + } else if ('returnDocs' in opts) { + // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release + returnDocs = opts.returnDocs; + } else { + returnDocs = true; } - docInfos.forEach(function (currentDoc, resultsIdx) { + var results = []; + var numResults = 0; + var filter = pouchdbUtils.filterChange(opts); + var docIdsToMetadata = new pouchdbCollections.Map(); - if (currentDoc._id && pouchdbMerge.isLocalId(currentDoc._id)) { - var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal'; - api[fun](currentDoc, {ctx: tx}, function (err, res) { - results[resultsIdx] = err || res; - checkAllDocsDone(); - }); + var txn; + var bySeqStore; + var docStore; + var docIdRevIndex; + + function onBatch(batchKeys, batchValues, cursor) { + if (!cursor || !batchKeys.length) { // done return; } - var id = currentDoc.metadata.id; - if (idsToDocs.has(id)) { - docsToDo--; // duplicate - idsToDocs.get(id).push([currentDoc, resultsIdx]); - } else { - idsToDocs.set(id, [[currentDoc, resultsIdx]]); - } - }); + var winningDocs = new Array(batchKeys.length); + var metadatas = new Array(batchKeys.length); - // in the case of new_edits, the user can provide multiple docs - // with the same id. these need to be processed sequentially - idsToDocs.forEach(function (docs, id) { - var numDone = 0; + function processMetadataAndWinningDoc(metadata, winningDoc) { + var change = opts.processChange(winningDoc, metadata, opts); + lastSeq = change.seq = metadata.seq; - function docWritten() { - if (++numDone < docs.length) { - nextDoc(); - } else { - checkAllDocsDone(); + var filtered = filter(change); + if (typeof filtered === 'object') { // anything but true/false indicates error + return opts.complete(filtered); + } + + if (filtered) { + numResults++; + if (returnDocs) { + results.push(change); + } + // process the attachment immediately + // for the benefit of live listeners + if (opts.attachments && opts.include_docs) { + fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () { + postProcessAttachments([change], opts.binary).then(function () { + opts.onChange(change); + }); + }); + } else { + opts.onChange(change); + } } } - function nextDoc() { - var value = docs[numDone]; - var currentDoc = value[0]; - var resultsIdx = value[1]; - if (fetchedDocs.has(id)) { - updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results, - resultsIdx, docWritten, writeDoc, newEdits); - } else { - // Ensure stemming applies to new writes as well - var merged = pouchdbMerge.merge([], currentDoc.metadata.rev_tree[0], revLimit); - currentDoc.metadata.rev_tree = merged.tree; - currentDoc.stemmedRevs = merged.stemmedRevs || []; - insertDoc(currentDoc, resultsIdx, docWritten); + function onBatchDone() { + for (var i = 0, len = winningDocs.length; i < len; i++) { + if (numResults === limit) { + break; + } + var winningDoc = winningDocs[i]; + if (!winningDoc) { + continue; + } + var metadata = metadatas[i]; + processMetadataAndWinningDoc(metadata, winningDoc); + } + + if (numResults !== limit) { + cursor.continue(); } } - nextDoc(); - }); -} -exports.allDocsKeysQuery = allDocsKeysQuery; -exports.invalidIdError = pouchdbUtils.invalidIdError; -exports.isDeleted = pouchdbMerge.isDeleted; -exports.isLocalId = pouchdbMerge.isLocalId; -exports.normalizeDdocFunctionName = pouchdbUtils.normalizeDdocFunctionName; -exports.parseDdocFunctionName = pouchdbUtils.parseDdocFunctionName; -exports.parseDoc = parseDoc; -exports.preprocessAttachments = preprocessAttachments; -exports.processDocs = processDocs; -exports.updateDoc = updateDoc; - -},{"pouchdb-binary-utils":517,"pouchdb-collections":513,"pouchdb-errors":529,"pouchdb-md5":537,"pouchdb-merge":538,"pouchdb-promise":514,"pouchdb-utils":542}],513:[function(require,module,exports){ -arguments[4][505][0].apply(exports,arguments) -},{"dup":505}],514:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],515:[function(require,module,exports){ -'use strict'; - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var pouchdbUtils = require('pouchdb-utils'); -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbBinaryUtils = require('pouchdb-binary-utils'); -var pouchdbErrors = require('pouchdb-errors'); - -/* global fetch */ -/* global Headers */ -function wrappedFetch() { - var wrappedPromise = {}; - - var promise = new Promise(function (resolve, reject) { - wrappedPromise.resolve = resolve; - wrappedPromise.reject = reject; - }); - - var args = new Array(arguments.length); - - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; + // Fetch all metadatas/winningdocs from this batch in parallel, then process + // them all only once all data has been collected. This is done in parallel + // because it's faster than doing it one-at-a-time. + var numDone = 0; + batchValues.forEach(function (value, i) { + var doc = decodeDoc(value); + var seq = batchKeys[i]; + fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) { + metadatas[i] = metadata; + winningDocs[i] = winningDoc; + if (++numDone === batchKeys.length) { + onBatchDone(); + } + }); + }); } - wrappedPromise.promise = promise; - - Promise.resolve().then(function () { - return fetch.apply(null, args); - }).then(function (response) { - wrappedPromise.resolve(response); - }).catch(function (error) { - wrappedPromise.reject(error); - }); - - return wrappedPromise; -} + function onGetMetadata(doc, seq, metadata, cb) { + if (metadata.seq !== seq) { + // some other seq is later + return cb(); + } -function fetchRequest(options, callback) { - var wrappedPromise, timer, response; + if (metadata.winningRev === doc._rev) { + // this is the winning doc + return cb(metadata, doc); + } - var headers = new Headers(); + // fetch winning doc in separate request + var docIdRev = doc._id + '::' + metadata.winningRev; + var req = docIdRevIndex.get(docIdRev); + req.onsuccess = function (e) { + cb(metadata, decodeDoc(e.target.result)); + }; + } - var fetchOptions = { - method: options.method, - credentials: 'include', - headers: headers - }; + function fetchWinningDocAndMetadata(doc, seq, cb) { + if (docIds && !docIds.has(doc._id)) { + return cb(); + } - if (options.json) { - headers.set('Accept', 'application/json'); - headers.set('Content-Type', options.headers['Content-Type'] || - 'application/json'); + var metadata = docIdsToMetadata.get(doc._id); + if (metadata) { // cached + return onGetMetadata(doc, seq, metadata, cb); + } + // metadata not cached, have to go fetch it + docStore.get(doc._id).onsuccess = function (e) { + metadata = decodeMetadata(e.target.result); + docIdsToMetadata.set(doc._id, metadata); + onGetMetadata(doc, seq, metadata, cb); + }; } - if (options.body && - options.processData && - typeof options.body !== 'string') { - fetchOptions.body = JSON.stringify(options.body); - } else if ('body' in options) { - fetchOptions.body = options.body; - } else { - fetchOptions.body = null; + function finish() { + opts.complete(null, { + results: results, + last_seq: lastSeq + }); } - Object.keys(options.headers).forEach(function (key) { - if (options.headers.hasOwnProperty(key)) { - headers.set(key, options.headers[key]); + function onTxnComplete() { + if (!opts.continuous && opts.attachments) { + // cannot guarantee that postProcessing was already done, + // so do it again + postProcessAttachments(results).then(finish); + } else { + finish(); } - }); - - wrappedPromise = wrappedFetch(options.url, fetchOptions); + } - if (options.timeout > 0) { - timer = setTimeout(function () { - wrappedPromise.reject(new Error('Load timeout for resource: ' + - options.url)); - }, options.timeout); + var objectStores = [DOC_STORE, BY_SEQ_STORE]; + if (opts.attachments) { + objectStores.push(ATTACH_STORE); + } + var txnResult = openTransactionSafely(idb, objectStores, 'readonly'); + if (txnResult.error) { + return opts.complete(txnResult.error); } + txn = txnResult.txn; + txn.onabort = idbError(opts.complete); + txn.oncomplete = onTxnComplete; - wrappedPromise.promise.then(function (fetchResponse) { - response = { - statusCode: fetchResponse.status - }; + bySeqStore = txn.objectStore(BY_SEQ_STORE); + docStore = txn.objectStore(DOC_STORE); + docIdRevIndex = bySeqStore.index('_doc_id_rev'); - if (options.timeout > 0) { - clearTimeout(timer); - } + var keyRange = (opts.since && !opts.descending) ? + IDBKeyRange.lowerBound(opts.since, true) : null; - if (response.statusCode >= 200 && response.statusCode < 300) { - return options.binary ? fetchResponse.blob() : fetchResponse.text(); - } + runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch); +} - return fetchResponse.json(); - }).then(function (result) { - if (response.statusCode >= 200 && response.statusCode < 300) { - callback(null, response, result); - } else { - result.status = response.statusCode; - callback(result); - } - }).catch(function (error) { - if (!error) { - // this happens when the listener is canceled - error = new Error('canceled'); - } - callback(error); - }); +var cachedDBs = new pouchdbCollections.Map(); +var blobSupportPromise; +var openReqList = new pouchdbCollections.Map(); - return {abort: wrappedPromise.reject}; -} +function IdbPouch(opts, callback) { + var api = this; -function xhRequest(options, callback) { + enqueueTask(function (thisCallback) { + init(api, opts, thisCallback); + }, callback, api.constructor); +} - var xhr, timer; - var timedout = false; +function init(api, opts, callback) { - var abortReq = function () { - xhr.abort(); - cleanUp(); - }; + var dbName = opts.name; - var timeoutReq = function () { - timedout = true; - xhr.abort(); - cleanUp(); - }; + var idb = null; + api._meta = null; - var ret = {abort: abortReq}; + // called when creating a fresh new database + function createSchema(db) { + var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'}); + db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true}) + .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); + db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'}); + db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false}); + db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); - var cleanUp = function () { - clearTimeout(timer); - ret.abort = function () {}; - if (xhr) { - xhr.onprogress = undefined; - if (xhr.upload) { - xhr.upload.onprogress = undefined; - } - xhr.onreadystatechange = undefined; - xhr = undefined; - } - }; + // added in v2 + docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); - if (options.xhr) { - xhr = new options.xhr(); - } else { - xhr = new XMLHttpRequest(); - } + // added in v3 + db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}); - try { - xhr.open(options.method, options.url); - } catch (exception) { - return callback(new Error(exception.name || 'Url is invalid')); + // added in v4 + var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, + {autoIncrement: true}); + attAndSeqStore.createIndex('seq', 'seq'); + attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } - xhr.withCredentials = ('withCredentials' in options) ? - options.withCredentials : true; + // migration to version 2 + // unfortunately "deletedOrLocal" is a misnomer now that we no longer + // store local docs in the main doc-store, but whaddyagonnado + function addDeletedOrLocalIndex(txn, callback) { + var docStore = txn.objectStore(DOC_STORE); + docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); - if (options.method === 'GET') { - delete options.headers['Content-Type']; - } else if (options.json) { - options.headers.Accept = 'application/json'; - options.headers['Content-Type'] = options.headers['Content-Type'] || - 'application/json'; - if (options.body && - options.processData && - typeof options.body !== "string") { - options.body = JSON.stringify(options.body); - } + docStore.openCursor().onsuccess = function (event) { + var cursor = event.target.result; + if (cursor) { + var metadata = cursor.value; + var deleted = pouchdbMerge.isDeleted(metadata); + metadata.deletedOrLocal = deleted ? "1" : "0"; + docStore.put(metadata); + cursor.continue(); + } else { + callback(); + } + }; } - if (options.binary) { - xhr.responseType = 'arraybuffer'; + // migration to version 3 (part 1) + function createLocalStoreSchema(db) { + db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}) + .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); } - if (!('body' in options)) { - options.body = null; + // migration to version 3 (part 2) + function migrateLocalStore(txn, cb) { + var localStore = txn.objectStore(LOCAL_STORE); + var docStore = txn.objectStore(DOC_STORE); + var seqStore = txn.objectStore(BY_SEQ_STORE); + + var cursor = docStore.openCursor(); + cursor.onsuccess = function (event) { + var cursor = event.target.result; + if (cursor) { + var metadata = cursor.value; + var docId = metadata.id; + var local = pouchdbMerge.isLocalId(docId); + var rev = pouchdbMerge.winningRev(metadata); + if (local) { + var docIdRev = docId + "::" + rev; + // remove all seq entries + // associated with this docId + var start = docId + "::"; + var end = docId + "::~"; + var index = seqStore.index('_doc_id_rev'); + var range = IDBKeyRange.bound(start, end, false, false); + var seqCursor = index.openCursor(range); + seqCursor.onsuccess = function (e) { + seqCursor = e.target.result; + if (!seqCursor) { + // done + docStore.delete(cursor.primaryKey); + cursor.continue(); + } else { + var data = seqCursor.value; + if (data._doc_id_rev === docIdRev) { + localStore.put(data); + } + seqStore.delete(seqCursor.primaryKey); + seqCursor.continue(); + } + }; + } else { + cursor.continue(); + } + } else if (cb) { + cb(); + } + }; } - for (var key in options.headers) { - if (options.headers.hasOwnProperty(key)) { - xhr.setRequestHeader(key, options.headers[key]); - } + // migration to version 4 (part 1) + function addAttachAndSeqStore(db) { + var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, + {autoIncrement: true}); + attAndSeqStore.createIndex('seq', 'seq'); + attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } - if (options.timeout > 0) { - timer = setTimeout(timeoutReq, options.timeout); - xhr.onprogress = function () { - clearTimeout(timer); - if (xhr.readyState !== 4) { - timer = setTimeout(timeoutReq, options.timeout); + // migration to version 4 (part 2) + function migrateAttsAndSeqs(txn, callback) { + var seqStore = txn.objectStore(BY_SEQ_STORE); + var attStore = txn.objectStore(ATTACH_STORE); + var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); + + // need to actually populate the table. this is the expensive part, + // so as an optimization, check first that this database even + // contains attachments + var req = attStore.count(); + req.onsuccess = function (e) { + var count = e.target.result; + if (!count) { + return callback(); // done } + + seqStore.openCursor().onsuccess = function (e) { + var cursor = e.target.result; + if (!cursor) { + return callback(); // done + } + var doc = cursor.value; + var seq = cursor.primaryKey; + var atts = Object.keys(doc._attachments || {}); + var digestMap = {}; + for (var j = 0; j < atts.length; j++) { + var att = doc._attachments[atts[j]]; + digestMap[att.digest] = true; // uniq digests, just in case + } + var digests = Object.keys(digestMap); + for (j = 0; j < digests.length; j++) { + var digest = digests[j]; + attAndSeqStore.put({ + seq: seq, + digestSeq: digest + '::' + seq + }); + } + cursor.continue(); + }; }; - if (typeof xhr.upload !== 'undefined') { // does not exist in ie9 - xhr.upload.onprogress = xhr.onprogress; - } } - xhr.onreadystatechange = function () { - if (xhr.readyState !== 4) { - return; - } - - var response = { - statusCode: xhr.status - }; + // migration to version 5 + // Instead of relying on on-the-fly migration of metadata, + // this brings the doc-store to its modern form: + // - metadata.winningrev + // - metadata.seq + // - stringify the metadata when storing it + function migrateMetadata(txn) { - if (xhr.status >= 200 && xhr.status < 300) { - var data; - if (options.binary) { - data = pouchdbBinaryUtils.blob([xhr.response || ''], { - type: xhr.getResponseHeader('Content-Type') - }); - } else { - data = xhr.responseText; - } - callback(null, response, data); - } else { - var err = {}; - if (timedout) { - err = new Error('ETIMEDOUT'); - err.code = 'ETIMEDOUT'; - } else if (typeof xhr.response === 'string') { - try { - err = JSON.parse(xhr.response); - } catch (e) {} + function decodeMetadataCompat(storedObject) { + if (!storedObject.data) { + // old format, when we didn't store it stringified + storedObject.deleted = storedObject.deletedOrLocal === '1'; + return storedObject; } - err.status = xhr.status; - callback(err); + return decodeMetadata(storedObject); } - cleanUp(); - }; - if (options.body && (options.body instanceof Blob)) { - pouchdbBinaryUtils.readAsArrayBuffer(options.body, function (arrayBuffer) { - xhr.send(arrayBuffer); - }); - } else { - xhr.send(options.body); - } + // ensure that every metadata has a winningRev and seq, + // which was previously created on-the-fly but better to migrate + var bySeqStore = txn.objectStore(BY_SEQ_STORE); + var docStore = txn.objectStore(DOC_STORE); + var cursor = docStore.openCursor(); + cursor.onsuccess = function (e) { + var cursor = e.target.result; + if (!cursor) { + return; // done + } + var metadata = decodeMetadataCompat(cursor.value); - return ret; -} + metadata.winningRev = metadata.winningRev || + pouchdbMerge.winningRev(metadata); -function testXhr() { - try { - new XMLHttpRequest(); - return true; - } catch (err) { - return false; - } -} + function fetchMetadataSeq() { + // metadata.seq was added post-3.2.0, so if it's missing, + // we need to fetch it manually + var start = metadata.id + '::'; + var end = metadata.id + '::\uffff'; + var req = bySeqStore.index('_doc_id_rev').openCursor( + IDBKeyRange.bound(start, end)); -var hasXhr = testXhr(); + var metadataSeq = 0; + req.onsuccess = function (e) { + var cursor = e.target.result; + if (!cursor) { + metadata.seq = metadataSeq; + return onGetMetadataSeq(); + } + var seq = cursor.primaryKey; + if (seq > metadataSeq) { + metadataSeq = seq; + } + cursor.continue(); + }; + } -function ajax$1(options, callback) { - if (!false && (hasXhr || options.xhr)) { - return xhRequest(options, callback); - } else { - return fetchRequest(options, callback); - } -} + function onGetMetadataSeq() { + var metadataToStore = encodeMetadata(metadata, + metadata.winningRev, metadata.deleted); -// the blob already has a type; do nothing + var req = docStore.put(metadataToStore); + req.onsuccess = function () { + cursor.continue(); + }; + } -function defaultBody() { - return ''; -} + if (metadata.seq) { + return onGetMetadataSeq(); + } -function ajaxCore(options, callback) { + fetchMetadataSeq(); + }; - options = pouchdbUtils.clone(options); + } - var defaultOptions = { - method : "GET", - headers: {}, - json: true, - processData: true, - timeout: 10000, - cache: false + api._remote = false; + api.type = function () { + return 'idb'; }; - options = pouchdbUtils.assign(defaultOptions, options); + api._id = pouchdbUtils.toPromise(function (callback) { + callback(null, api._meta.instanceId); + }); - function onSuccess(obj, resp, cb) { - if (!options.binary && options.json && typeof obj === 'string') { - /* istanbul ignore next */ - try { - obj = JSON.parse(obj); - } catch (e) { - // Probably a malformed JSON from server - return cb(e); + api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) { + idbBulkDocs(opts, req, reqOpts, api, idb, callback); + }; + + // First we look up the metadata in the ids database, then we fetch the + // current revision(s) from the by sequence store + api._get = function idb_get(id, opts, callback) { + var doc; + var metadata; + var err; + var txn = opts.ctx; + if (!txn) { + var txnResult = openTransactionSafely(idb, + [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); } + txn = txnResult.txn; } - if (Array.isArray(obj)) { - obj = obj.map(function (v) { - if (v.error || v.missing) { - return pouchdbErrors.generateErrorFromResponse(v); - } else { - return v; - } - }); - } - if (options.binary) { - - } - cb(null, obj, resp); - } - if (options.json) { - if (!options.binary) { - options.headers.Accept = 'application/json'; + function finish() { + callback(err, {doc: doc, metadata: metadata, ctx: txn}); } - options.headers['Content-Type'] = options.headers['Content-Type'] || - 'application/json'; - } - - if (options.binary) { - options.encoding = null; - options.json = false; - } - - if (!options.processData) { - options.json = false; - } - return ajax$1(options, function (err, response, body) { + txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) { + metadata = decodeMetadata(e.target.result); + // we can determine the result here if: + // 1. there is no such document + // 2. the document is deleted and we don't ask about specific rev + // When we ask with opts.rev we expect the answer to be either + // doc (possibly with _deleted=true) or missing error + if (!metadata) { + err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'missing'); + return finish(); + } - if (err) { - return callback(pouchdbErrors.generateErrorFromResponse(err)); - } + var rev; + if (!opts.rev) { + rev = metadata.winningRev; + var deleted = pouchdbMerge.isDeleted(metadata); + if (deleted) { + err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, "deleted"); + return finish(); + } + } else { + rev = opts.latest ? pouchdbMerge.latest(opts.rev, metadata) : opts.rev; + } - var error; - var content_type = response.headers && response.headers['content-type']; - var data = body || defaultBody(); + var objectStore = txn.objectStore(BY_SEQ_STORE); + var key = metadata.id + '::' + rev; - // CouchDB doesn't always return the right content-type for JSON data, so - // we check for ^{ and }$ (ignoring leading/trailing whitespace) - if (!options.binary && (options.json || !options.processData) && - typeof data !== 'object' && - (/json/.test(content_type) || - (/^[\s]*\{/.test(data) && /\}[\s]*$/.test(data)))) { - try { - data = JSON.parse(data.toString()); - } catch (e) {} - } + objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) { + doc = e.target.result; + if (doc) { + doc = decodeDoc(doc); + } + if (!doc) { + err = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'missing'); + return finish(); + } + finish(); + }; + }; + }; - if (response.statusCode >= 200 && response.statusCode < 300) { - onSuccess(data, response, callback); + api._getAttachment = function (docId, attachId, attachment, opts, callback) { + var txn; + if (opts.ctx) { + txn = opts.ctx; } else { - error = pouchdbErrors.generateErrorFromResponse(data); - error.status = response.statusCode; - callback(error); + var txnResult = openTransactionSafely(idb, + [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); + } + txn = txnResult.txn; } - }); -} + var digest = attachment.digest; + var type = attachment.content_type; -function ajax(opts, callback) { + txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) { + var body = e.target.result.body; + readBlobData(body, type, opts.binary, function (blobData) { + callback(null, blobData); + }); + }; + }; - // cache-buster, specifically designed to work around IE's aggressive caching - // see http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/ - // Also Safari caches POSTs, so we need to cache-bust those too. - var ua = (navigator && navigator.userAgent) ? - navigator.userAgent.toLowerCase() : ''; + api._info = function idb_info(callback) { + var updateSeq; + var docCount; - var isSafari = ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1; - var isIE = ua.indexOf('msie') !== -1; - var isTrident = ua.indexOf('trident') !== -1; - var isEdge = ua.indexOf('edge') !== -1; + var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); + } + var txn = txnResult.txn; + txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { + docCount = e.target.result.docCount; + }; + txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) { + var cursor = e.target.result; + updateSeq = cursor ? cursor.key : 0; + }; - // it appears the new version of safari also caches GETs, - // see https://github.com/pouchdb/pouchdb/issues/5010 - var shouldCacheBust = (isSafari || - ((isIE || isTrident || isEdge) && opts.method === 'GET')); + txn.oncomplete = function () { + callback(null, { + doc_count: docCount, + update_seq: updateSeq, + // for debugging + idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64') + }); + }; + }; - var cache = 'cache' in opts ? opts.cache : true; + api._allDocs = function idb_allDocs(opts, callback) { + idbAllDocs(opts, idb, callback); + }; - var isBlobUrl = /^blob:/.test(opts.url); // don't append nonces for blob URLs + api._changes = function idbChanges(opts) { + return changes(opts, api, dbName, idb); + }; - if (!isBlobUrl && (shouldCacheBust || !cache)) { - var hasArgs = opts.url.indexOf('?') !== -1; - opts.url += (hasArgs ? '&' : '?') + '_nonce=' + Date.now(); - } + api._close = function (callback) { + // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close + // "Returns immediately and closes the connection in a separate thread..." + idb.close(); + cachedDBs.delete(dbName); + callback(); + }; - return ajaxCore(opts, callback); -} + api._getRevisionTree = function (docId, callback) { + var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); + } + var txn = txnResult.txn; + var req = txn.objectStore(DOC_STORE).get(docId); + req.onsuccess = function (event) { + var doc = decodeMetadata(event.target.result); + if (!doc) { + callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); + } else { + callback(null, doc.rev_tree); + } + }; + }; -module.exports = ajax; + // This function removes revisions of document docId + // which are listed in revs and sets this document + // revision to to rev_tree + api._doCompaction = function (docId, revs, callback) { + var stores = [ + DOC_STORE, + BY_SEQ_STORE, + ATTACH_STORE, + ATTACH_AND_SEQ_STORE + ]; + var txnResult = openTransactionSafely(idb, stores, 'readwrite'); + if (txnResult.error) { + return callback(txnResult.error); + } + var txn = txnResult.txn; -},{"pouchdb-binary-utils":517,"pouchdb-errors":529,"pouchdb-promise":516,"pouchdb-utils":542}],516:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],517:[function(require,module,exports){ -'use strict'; + var docStore = txn.objectStore(DOC_STORE); -Object.defineProperty(exports, '__esModule', { value: true }); + docStore.get(docId).onsuccess = function (event) { + var metadata = decodeMetadata(event.target.result); + pouchdbMerge.traverseRevTree(metadata.rev_tree, function (isLeaf, pos, + revHash, ctx, opts) { + var rev = pos + '-' + revHash; + if (revs.indexOf(rev) !== -1) { + opts.status = 'missing'; + } + }); + compactRevs(revs, docId, txn); + var winningRev = metadata.winningRev; + var deleted = metadata.deleted; + txn.objectStore(DOC_STORE).put( + encodeMetadata(metadata, winningRev, deleted)); + }; + txn.onabort = idbError(callback); + txn.oncomplete = function () { + callback(); + }; + }; -var thisAtob = function (str) { - return atob(str); -}; -var thisBtoa = function (str) { - return btoa(str); -}; + api._getLocal = function (id, callback) { + var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly'); + if (txnResult.error) { + return callback(txnResult.error); + } + var tx = txnResult.txn; + var req = tx.objectStore(LOCAL_STORE).get(id); -// Abstracts constructing a Blob object, so it also works in older -// browsers that don't support the native Blob constructor (e.g. -// old QtWebKit versions, Android < 4.4). -function createBlob(parts, properties) { - /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ - parts = parts || []; - properties = properties || {}; - try { - return new Blob(parts, properties); - } catch (e) { - if (e.name !== "TypeError") { - throw e; + req.onerror = idbError(callback); + req.onsuccess = function (e) { + var doc = e.target.result; + if (!doc) { + callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); + } else { + delete doc['_doc_id_rev']; // for backwards compat + callback(null, doc); + } + }; + }; + + api._putLocal = function (doc, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; } - var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : - typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : - typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : - WebKitBlobBuilder; - var builder = new Builder(); - for (var i = 0; i < parts.length; i += 1) { - builder.append(parts[i]); + delete doc._revisions; // ignore this, trust the rev + var oldRev = doc._rev; + var id = doc._id; + if (!oldRev) { + doc._rev = '0-1'; + } else { + doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1); } - return builder.getBlob(properties.type); - } -} -// From http://stackoverflow.com/questions/14967647/ (continues on next line) -// encode-decode-image-with-base64-breaks-image (2013-04-21) -function binaryStringToArrayBuffer(bin) { - var length = bin.length; - var buf = new ArrayBuffer(length); - var arr = new Uint8Array(buf); - for (var i = 0; i < length; i++) { - arr[i] = bin.charCodeAt(i); - } - return buf; -} + var tx = opts.ctx; + var ret; + if (!tx) { + var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); + if (txnResult.error) { + return callback(txnResult.error); + } + tx = txnResult.txn; + tx.onerror = idbError(callback); + tx.oncomplete = function () { + if (ret) { + callback(null, ret); + } + }; + } -function binStringToBluffer(binString, type) { - return createBlob([binaryStringToArrayBuffer(binString)], {type: type}); -} + var oStore = tx.objectStore(LOCAL_STORE); + var req; + if (oldRev) { + req = oStore.get(id); + req.onsuccess = function (e) { + var oldDoc = e.target.result; + if (!oldDoc || oldDoc._rev !== oldRev) { + callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); + } else { // update + var req = oStore.put(doc); + req.onsuccess = function () { + ret = {ok: true, id: doc._id, rev: doc._rev}; + if (opts.ctx) { // return immediately + callback(null, ret); + } + }; + } + }; + } else { // new doc + req = oStore.add(doc); + req.onerror = function (e) { + // constraint error, already exists + callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); + e.preventDefault(); // avoid transaction abort + e.stopPropagation(); // avoid transaction onerror + }; + req.onsuccess = function () { + ret = {ok: true, id: doc._id, rev: doc._rev}; + if (opts.ctx) { // return immediately + callback(null, ret); + } + }; + } + }; -function b64ToBluffer(b64, type) { - return binStringToBluffer(thisAtob(b64), type); -} + api._removeLocal = function (doc, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + var tx = opts.ctx; + if (!tx) { + var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); + if (txnResult.error) { + return callback(txnResult.error); + } + tx = txnResult.txn; + tx.oncomplete = function () { + if (ret) { + callback(null, ret); + } + }; + } + var ret; + var id = doc._id; + var oStore = tx.objectStore(LOCAL_STORE); + var req = oStore.get(id); -//Can't find original post, but this is close -//http://stackoverflow.com/questions/6965107/ (continues on next line) -//converting-between-strings-and-arraybuffers -function arrayBufferToBinaryString(buffer) { - var binary = ''; - var bytes = new Uint8Array(buffer); - var length = bytes.byteLength; - for (var i = 0; i < length; i++) { - binary += String.fromCharCode(bytes[i]); - } - return binary; -} + req.onerror = idbError(callback); + req.onsuccess = function (e) { + var oldDoc = e.target.result; + if (!oldDoc || oldDoc._rev !== doc._rev) { + callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); + } else { + oStore.delete(id); + ret = {ok: true, id: id, rev: '0-0'}; + if (opts.ctx) { // return immediately + callback(null, ret); + } + } + }; + }; -// shim for browsers that don't support it -function readAsBinaryString(blob, callback) { - if (typeof FileReader === 'undefined') { - // fix for Firefox in a web worker - // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 - return callback(arrayBufferToBinaryString( - new FileReaderSync().readAsArrayBuffer(blob))); - } + api._destroy = function (opts, callback) { + changesHandler.removeAllListeners(dbName); - var reader = new FileReader(); - var hasBinaryString = typeof reader.readAsBinaryString === 'function'; - reader.onloadend = function (e) { - var result = e.target.result || ''; - if (hasBinaryString) { - return callback(result); + //Close open request for "dbName" database to fix ie delay. + var openReq = openReqList.get(dbName); + if (openReq && openReq.result) { + openReq.result.close(); + cachedDBs.delete(dbName); } - callback(arrayBufferToBinaryString(result)); + var req = indexedDB.deleteDatabase(dbName); + + req.onsuccess = function () { + //Remove open request from the list. + openReqList.delete(dbName); + if (pouchdbUtils.hasLocalStorage() && (dbName in localStorage)) { + delete localStorage[dbName]; + } + callback(null, { 'ok': true }); + }; + + req.onerror = idbError(callback); }; - if (hasBinaryString) { - reader.readAsBinaryString(blob); - } else { - reader.readAsArrayBuffer(blob); - } -} -function blobToBinaryString(blobOrBuffer, callback) { - readAsBinaryString(blobOrBuffer, function (bin) { - callback(bin); - }); -} + var cached = cachedDBs.get(dbName); -function blobToBase64(blobOrBuffer, callback) { - blobToBinaryString(blobOrBuffer, function (base64) { - callback(thisBtoa(base64)); - }); -} + if (cached) { + idb = cached.idb; + api._meta = cached.global; + return pouchdbUtils.nextTick(function () { + callback(null, api); + }); + } -// simplified API. universal browser support is assumed -function readAsArrayBuffer(blob, callback) { - if (typeof FileReader === 'undefined') { - // fix for Firefox in a web worker: - // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 - return callback(new FileReaderSync().readAsArrayBuffer(blob)); + var req; + if (opts.storage) { + req = tryStorageOption(dbName, opts.storage); + } else { + req = indexedDB.open(dbName, ADAPTER_VERSION); } - var reader = new FileReader(); - reader.onloadend = function (e) { - var result = e.target.result || new ArrayBuffer(0); - callback(result); - }; - reader.readAsArrayBuffer(blob); -} + openReqList.set(dbName, req); -// this is not used in the browser -function typedBuffer() { -} + req.onupgradeneeded = function (e) { + var db = e.target.result; + if (e.oldVersion < 1) { + return createSchema(db); // new db, initial schema + } + // do migrations -exports.atob = thisAtob; -exports.btoa = thisBtoa; -exports.base64StringToBlobOrBuffer = b64ToBluffer; -exports.binaryStringToArrayBuffer = binaryStringToArrayBuffer; -exports.binaryStringToBlobOrBuffer = binStringToBluffer; -exports.blob = createBlob; -exports.blobOrBufferToBase64 = blobToBase64; -exports.blobOrBufferToBinaryString = blobToBinaryString; -exports.readAsArrayBuffer = readAsArrayBuffer; -exports.readAsBinaryString = readAsBinaryString; -exports.typedBuffer = typedBuffer; - -},{}],518:[function(require,module,exports){ -'use strict'; - -var pouchdbErrors = require('pouchdb-errors'); -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbSelectorCore = require('pouchdb-selector-core'); - -function evalFilter(input) { - return pouchdbUtils.scopeEval('"use strict";\nreturn ' + input + ';', {}); -} - -function evalView(input) { - var code = [ - 'return function(doc) {', - ' "use strict";', - ' var emitted = false;', - ' var emit = function (a, b) {', - ' emitted = true;', - ' };', - ' var view = ' + input + ';', - ' view(doc);', - ' if (emitted) {', - ' return true;', - ' }', - '};' - ].join('\n'); - - return pouchdbUtils.scopeEval(code, {}); -} - -function validate(opts, callback) { - if (opts.selector) { - if (opts.filter && opts.filter !== '_selector') { - var filterName = typeof opts.filter === 'string' ? - opts.filter : 'function'; - return callback(new Error('selector invalid for filter "' + filterName + '"')); - } - } - callback(); -} - -function normalize(opts) { - if (opts.view && !opts.filter) { - opts.filter = '_view'; - } - - if (opts.selector && !opts.filter) { - opts.filter = '_selector'; - } + var txn = e.currentTarget.transaction; + // these migrations have to be done in this function, before + // control is returned to the event loop, because IndexedDB - if (opts.filter && typeof opts.filter === 'string') { - if (opts.filter === '_view') { - opts.view = pouchdbUtils.normalizeDdocFunctionName(opts.view); - } else { - opts.filter = pouchdbUtils.normalizeDdocFunctionName(opts.filter); + if (e.oldVersion < 3) { + createLocalStoreSchema(db); // v2 -> v3 } - } -} - -function shouldFilter(changesHandler, opts) { - return opts.filter && typeof opts.filter === 'string' && - !opts.doc_ids && !pouchdbUtils.isRemote(changesHandler.db); -} - -function filter(changesHandler, opts) { - var callback = opts.complete; - if (opts.filter === '_view') { - if (!opts.view || typeof opts.view !== 'string') { - var err = pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, - '`view` filter parameter not found or invalid.'); - return callback(err); + if (e.oldVersion < 4) { + addAttachAndSeqStore(db); // v3 -> v4 } - // fetch a view from a design doc, make it behave like a filter - var viewName = pouchdbUtils.parseDdocFunctionName(opts.view); - changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) { - /* istanbul ignore if */ - if (changesHandler.isCancelled) { - return callback(null, {status: 'cancelled'}); - } - /* istanbul ignore next */ - if (err) { - return callback(pouchdbErrors.generateErrorFromResponse(err)); - } - var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] && - ddoc.views[viewName[1]].map; - if (!mapFun) { - return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, - (ddoc.views ? 'missing json key: ' + viewName[1] : - 'missing json key: views'))); - } - opts.filter = evalView(mapFun); - changesHandler.doChanges(opts); - }); - } else if (opts.selector) { - opts.filter = function (doc) { - return pouchdbSelectorCore.matchesSelector(doc, opts.selector); - }; - changesHandler.doChanges(opts); - } else { - // fetch a filter from a design doc - var filterName = pouchdbUtils.parseDdocFunctionName(opts.filter); - changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) { - /* istanbul ignore if */ - if (changesHandler.isCancelled) { - return callback(null, {status: 'cancelled'}); - } - /* istanbul ignore next */ - if (err) { - return callback(pouchdbErrors.generateErrorFromResponse(err)); - } - var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]]; - if (!filterFun) { - return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, - ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1] - : 'missing json key: filters'))); - } - opts.filter = evalFilter(filterFun); - changesHandler.doChanges(opts); - }); - } -} - -function applyChangesFilterPlugin(PouchDB) { - PouchDB._changesFilterPlugin = { - validate: validate, - normalize: normalize, - shouldFilter: shouldFilter, - filter: filter - }; -} - -module.exports = applyChangesFilterPlugin; -},{"pouchdb-errors":529,"pouchdb-selector-core":541,"pouchdb-utils":542}],519:[function(require,module,exports){ -'use strict'; - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbCollate = require('pouchdb-collate'); + var migrations = [ + addDeletedOrLocalIndex, // v1 -> v2 + migrateLocalStore, // v2 -> v3 + migrateAttsAndSeqs, // v3 -> v4 + migrateMetadata // v4 -> v5 + ]; -var CHECKPOINT_VERSION = 1; -var REPLICATOR = "pouchdb"; -// This is an arbitrary number to limit the -// amount of replication history we save in the checkpoint. -// If we save too much, the checkpoing docs will become very big, -// if we save fewer, we'll run a greater risk of having to -// read all the changes from 0 when checkpoint PUTs fail -// CouchDB 2.0 has a more involved history pruning, -// but let's go for the simple version for now. -var CHECKPOINT_HISTORY_SIZE = 5; -var LOWEST_SEQ = 0; + var i = e.oldVersion; -function updateCheckpoint(db, id, checkpoint, session, returnValue) { - return db.get(id).catch(function (err) { - if (err.status === 404) { - if (db.adapter === 'http' || db.adapter === 'https') { - pouchdbUtils.explainError( - 404, 'PouchDB is just checking if a remote checkpoint exists.' - ); + function next() { + var migration = migrations[i - 1]; + i++; + if (migration) { + migration(txn, next); } - return { - session_id: session, - _id: id, - history: [], - replicator: REPLICATOR, - version: CHECKPOINT_VERSION - }; - } - throw err; - }).then(function (doc) { - if (returnValue.cancelled) { - return; - } - - // if the checkpoint has not changed, do not update - if (doc.last_seq === checkpoint) { - return; } - // Filter out current entry for this replication - doc.history = (doc.history || []).filter(function (item) { - return item.session_id !== session; - }); - - // Add the latest checkpoint to history - doc.history.unshift({ - last_seq: checkpoint, - session_id: session - }); - - // Just take the last pieces in history, to - // avoid really big checkpoint docs. - // see comment on history size above - doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE); - - doc.version = CHECKPOINT_VERSION; - doc.replicator = REPLICATOR; - - doc.session_id = session; - doc.last_seq = checkpoint; + next(); + }; - return db.put(doc).catch(function (err) { - if (err.status === 409) { - // retry; someone is trying to write a checkpoint simultaneously - return updateCheckpoint(db, id, checkpoint, session, returnValue); - } - throw err; - }); - }); -} + req.onsuccess = function (e) { -function Checkpointer(src, target, id, returnValue, opts) { - this.src = src; - this.target = target; - this.id = id; - this.returnValue = returnValue; - this.opts = opts || {}; -} + idb = e.target.result; -Checkpointer.prototype.writeCheckpoint = function (checkpoint, session) { - var self = this; - return this.updateTarget(checkpoint, session).then(function () { - return self.updateSource(checkpoint, session); - }); -}; + idb.onversionchange = function () { + idb.close(); + cachedDBs.delete(dbName); + }; -Checkpointer.prototype.updateTarget = function (checkpoint, session) { - if (this.opts.writeTargetCheckpoint) { - return updateCheckpoint(this.target, this.id, checkpoint, - session, this.returnValue); - } else { - return Promise.resolve(true); - } -}; + idb.onabort = function (e) { + pouchdbUtils.guardedConsole('error', 'Database has a global failure', e.target.error); + idb.close(); + cachedDBs.delete(dbName); + }; -Checkpointer.prototype.updateSource = function (checkpoint, session) { - if (this.opts.writeSourceCheckpoint) { - var self = this; - return updateCheckpoint(this.src, this.id, checkpoint, - session, this.returnValue) - .catch(function (err) { - if (isForbiddenError(err)) { - self.opts.writeSourceCheckpoint = false; - return true; - } - throw err; - }); - } else { - return Promise.resolve(true); - } -}; + // Do a few setup operations (in parallel as much as possible): + // 1. Fetch meta doc + // 2. Check blob support + // 3. Calculate docCount + // 4. Generate an instanceId if necessary + // 5. Store docCount and instanceId on meta doc -var comparisons = { - "undefined": function (targetDoc, sourceDoc) { - // This is the previous comparison function - if (pouchdbCollate.collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) { - return sourceDoc.last_seq; - } - /* istanbul ignore next */ - return 0; - }, - "1": function (targetDoc, sourceDoc) { - // This is the comparison function ported from CouchDB - return compareReplicationLogs(sourceDoc, targetDoc).last_seq; - } -}; + var txn = idb.transaction([ + META_STORE, + DETECT_BLOB_SUPPORT_STORE, + DOC_STORE + ], 'readwrite'); -Checkpointer.prototype.getCheckpoint = function () { - var self = this; + var storedMetaDoc = false; + var metaDoc; + var docCount; + var blobSupport; + var instanceId; - if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) { - return self.src.get(self.id).then(function (sourceDoc) { - return sourceDoc.last_seq || LOWEST_SEQ; - }).catch(function (err) { - /* istanbul ignore if */ - if (err.status !== 404) { - throw err; + function completeSetup() { + if (typeof blobSupport === 'undefined' || !storedMetaDoc) { + return; } - return LOWEST_SEQ; - }); - } + api._meta = { + name: dbName, + instanceId: instanceId, + blobSupport: blobSupport + }; - return self.target.get(self.id).then(function (targetDoc) { - if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) { - return targetDoc.last_seq || LOWEST_SEQ; + cachedDBs.set(dbName, { + idb: idb, + global: api._meta + }); + callback(null, api); } - return self.src.get(self.id).then(function (sourceDoc) { - // Since we can't migrate an old version doc to a new one - // (no session id), we just go with the lowest seq in this case - /* istanbul ignore if */ - if (targetDoc.version !== sourceDoc.version) { - return LOWEST_SEQ; + function storeMetaDocIfReady() { + if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') { + return; } - - var version; - if (targetDoc.version) { - version = targetDoc.version.toString(); + var instanceKey = dbName + '_id'; + if (instanceKey in metaDoc) { + instanceId = metaDoc[instanceKey]; } else { - version = "undefined"; - } - - if (version in comparisons) { - return comparisons[version](targetDoc, sourceDoc); - } - /* istanbul ignore next */ - return LOWEST_SEQ; - }, function (err) { - if (err.status === 404 && targetDoc.last_seq) { - return self.src.put({ - _id: self.id, - last_seq: LOWEST_SEQ - }).then(function () { - return LOWEST_SEQ; - }, function (err) { - if (isForbiddenError(err)) { - self.opts.writeSourceCheckpoint = false; - return targetDoc.last_seq; - } - /* istanbul ignore next */ - return LOWEST_SEQ; - }); + metaDoc[instanceKey] = instanceId = pouchdbUtils.uuid(); } - throw err; - }); - }).catch(function (err) { - if (err.status !== 404) { - throw err; + metaDoc.docCount = docCount; + txn.objectStore(META_STORE).put(metaDoc); } - return LOWEST_SEQ; - }); -}; -// This checkpoint comparison is ported from CouchDBs source -// they come from here: -// https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906 -function compareReplicationLogs(srcDoc, tgtDoc) { - if (srcDoc.session_id === tgtDoc.session_id) { - return { - last_seq: srcDoc.last_seq, - history: srcDoc.history + // + // fetch or generate the instanceId + // + txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { + metaDoc = e.target.result || { id: META_STORE }; + storeMetaDocIfReady(); }; - } - - return compareReplicationHistory(srcDoc.history, tgtDoc.history); -} -function compareReplicationHistory(sourceHistory, targetHistory) { - // the erlang loop via function arguments is not so easy to repeat in JS - // therefore, doing this as recursion - var S = sourceHistory[0]; - var sourceRest = sourceHistory.slice(1); - var T = targetHistory[0]; - var targetRest = targetHistory.slice(1); + // + // countDocs + // + countDocs(txn, function (count) { + docCount = count; + storeMetaDocIfReady(); + }); - if (!S || targetHistory.length === 0) { - return { - last_seq: LOWEST_SEQ, - history: [] - }; - } + // + // check blob support + // + if (!blobSupportPromise) { + // make sure blob support is only checked once + blobSupportPromise = checkBlobSupport(txn); + } - var sourceId = S.session_id; - /* istanbul ignore if */ - if (hasSessionId(sourceId, targetHistory)) { - return { - last_seq: S.last_seq, - history: sourceHistory - }; - } + blobSupportPromise.then(function (val) { + blobSupport = val; + completeSetup(); + }); - var targetId = T.session_id; - if (hasSessionId(targetId, sourceRest)) { - return { - last_seq: T.last_seq, - history: targetRest + // only when the metadata put transaction has completed, + // consider the setup done + txn.oncomplete = function () { + storedMetaDoc = true; + completeSetup(); }; - } + txn.onabort = idbError(callback); + }; - return compareReplicationHistory(sourceRest, targetRest); + req.onerror = function () { + var msg = 'Failed to open indexedDB, are you in private browsing mode?'; + pouchdbUtils.guardedConsole('error', msg); + callback(pouchdbErrors.createError(pouchdbErrors.IDB_ERROR, msg)); + }; } -function hasSessionId(sessionId, history) { - var props = history[0]; - var rest = history.slice(1); +IdbPouch.valid = function () { + // Issue #2533, we finally gave up on doing bug + // detection instead of browser sniffing. Safari brought us + // to our knees. + var isSafari = typeof openDatabase !== 'undefined' && + /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && + !/Chrome/.test(navigator.userAgent) && + !/BlackBerry/.test(navigator.platform); - if (!sessionId || history.length === 0) { + // Safari <10.1 does not meet our requirements for IDB support (#5572) + // since Safari 10.1 shipped with fetch, we can use that to detect it + var hasFetch = typeof fetch === 'function' && + fetch.toString().indexOf('[native code') !== -1; + + // On Firefox SecurityError is thrown while referencing indexedDB if cookies + // are not allowed. `typeof indexedDB` also triggers the error. + try { + // some outdated implementations of IDB that appear on Samsung + // and HTC Android devices <4.4 are missing IDBKeyRange + return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' && + typeof IDBKeyRange !== 'undefined'; + } catch (e) { return false; } +}; - if (sessionId === props.session_id) { - return true; +function tryStorageOption(dbName, storage) { + try { // option only available in Firefox 26+ + return indexedDB.open(dbName, { + version: ADAPTER_VERSION, + storage: storage + }); + } catch (err) { + return indexedDB.open(dbName, ADAPTER_VERSION); } - - return hasSessionId(sessionId, rest); } -function isForbiddenError(err) { - return typeof err.status === 'number' && Math.floor(err.status / 100) === 4; +function index (PouchDB) { + PouchDB.adapter('idb', IdbPouch, true); } -module.exports = Checkpointer; +module.exports = index; -},{"pouchdb-collate":521,"pouchdb-promise":520,"pouchdb-utils":542}],520:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],521:[function(require,module,exports){ +},{"pouchdb-adapter-utils":519,"pouchdb-binary-utils":520,"pouchdb-collections":521,"pouchdb-errors":522,"pouchdb-json":523,"pouchdb-merge":525,"pouchdb-promise":526,"pouchdb-utils":527}],518:[function(require,module,exports){ +arguments[4][501][0].apply(exports,arguments) +},{"dup":501}],519:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); -function pad(str, padWith, upToLength) { - var padding = ''; - var targetLength = upToLength - str.length; - /* istanbul ignore next */ - while (padding.length < targetLength) { - padding += padWith; - } - return padding; -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -function padLeft(str, padWith, upToLength) { - var padding = pad(str, padWith, upToLength); - return padding + str; +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbErrors = require('pouchdb-errors'); +var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var pouchdbMd5 = require('pouchdb-md5'); +var pouchdbMerge = require('pouchdb-merge'); +var pouchdbCollections = require('pouchdb-collections'); + +function allDocsKeysQuery(api, opts) { + var keys = opts.keys; + var finalResults = { + offset: opts.skip + }; + return Promise.all(keys.map(function (key) { + var subOpts = pouchdbUtils.assign({key: key, deleted: 'ok'}, opts); + ['limit', 'skip', 'keys'].forEach(function (optKey) { + delete subOpts[optKey]; + }); + return new Promise(function (resolve, reject) { + api._allDocs(subOpts, function (err, res) { + /* istanbul ignore if */ + if (err) { + return reject(err); + } + /* istanbul ignore if */ + if (opts.update_seq && res.update_seq !== undefined) { + finalResults.update_seq = res.update_seq; + } + finalResults.total_rows = res.total_rows; + resolve(res.rows[0] || {key: key, error: 'not_found'}); + }); + }); + })).then(function (results) { + finalResults.rows = results; + return finalResults; + }); } -var MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE -var MAGNITUDE_DIGITS = 3; // ditto -var SEP = ''; // set to '_' for easier debugging +function toObject(array) { + return array.reduce(function (obj, item) { + obj[item] = true; + return obj; + }, {}); +} +// List of top level reserved words for doc +var reservedWords = toObject([ + '_id', + '_rev', + '_attachments', + '_deleted', + '_revisions', + '_revs_info', + '_conflicts', + '_deleted_conflicts', + '_local_seq', + '_rev_tree', + //replication documents + '_replication_id', + '_replication_state', + '_replication_state_time', + '_replication_state_reason', + '_replication_stats', + // Specific to Couchbase Sync Gateway + '_removed' +]); -function collate(a, b) { +// List of reserved words that should end up the document +var dataWords = toObject([ + '_attachments', + //replication documents + '_replication_id', + '_replication_state', + '_replication_state_time', + '_replication_state_reason', + '_replication_stats' +]); - if (a === b) { - return 0; +function parseRevisionInfo(rev) { + if (!/^\d+-./.test(rev)) { + return pouchdbErrors.createError(pouchdbErrors.INVALID_REV); } + var idx = rev.indexOf('-'); + var left = rev.substring(0, idx); + var right = rev.substring(idx + 1); + return { + prefix: parseInt(left, 10), + id: right + }; +} - a = normalizeKey(a); - b = normalizeKey(b); +function makeRevTreeFromRevisions(revisions, opts) { + var pos = revisions.start - revisions.ids.length + 1; - var ai = collationIndex(a); - var bi = collationIndex(b); - if ((ai - bi) !== 0) { - return ai - bi; - } - switch (typeof a) { - case 'number': - return a - b; - case 'boolean': - return a < b ? -1 : 1; - case 'string': - return stringCollate(a, b); - } - return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b); -} + var revisionIds = revisions.ids; + var ids = [revisionIds[0], opts, []]; -// couch considers null/NaN/Infinity/-Infinity === undefined, -// for the purposes of mapreduce indexes. also, dates get stringified. -function normalizeKey(key) { - switch (typeof key) { - case 'undefined': - return null; - case 'number': - if (key === Infinity || key === -Infinity || isNaN(key)) { - return null; - } - return key; - case 'object': - var origKey = key; - if (Array.isArray(key)) { - var len = key.length; - key = new Array(len); - for (var i = 0; i < len; i++) { - key[i] = normalizeKey(origKey[i]); - } - /* istanbul ignore next */ - } else if (key instanceof Date) { - return key.toJSON(); - } else if (key !== null) { // generic object - key = {}; - for (var k in origKey) { - if (origKey.hasOwnProperty(k)) { - var val = origKey[k]; - if (typeof val !== 'undefined') { - key[k] = normalizeKey(val); - } - } - } - } + for (var i = 1, len = revisionIds.length; i < len; i++) { + ids = [revisionIds[i], {status: 'missing'}, [ids]]; } - return key; -} -function indexify(key) { - if (key !== null) { - switch (typeof key) { - case 'boolean': - return key ? 1 : 0; - case 'number': - return numToIndexableString(key); - case 'string': - // We've to be sure that key does not contain \u0000 - // Do order-preserving replacements: - // 0 -> 1, 1 - // 1 -> 1, 2 - // 2 -> 2, 2 - return key - .replace(/\u0002/g, '\u0002\u0002') - .replace(/\u0001/g, '\u0001\u0002') - .replace(/\u0000/g, '\u0001\u0001'); - case 'object': - var isArray = Array.isArray(key); - var arr = isArray ? key : Object.keys(key); - var i = -1; - var len = arr.length; - var result = ''; - if (isArray) { - while (++i < len) { - result += toIndexableString(arr[i]); - } - } else { - while (++i < len) { - var objKey = arr[i]; - result += toIndexableString(objKey) + - toIndexableString(key[objKey]); - } - } - return result; - } - } - return ''; + return [{ + pos: pos, + ids: ids + }]; } -// convert the given key to a string that would be appropriate -// for lexical sorting, e.g. within a database, where the -// sorting is the same given by the collate() function. -function toIndexableString(key) { - var zero = '\u0000'; - key = normalizeKey(key); - return collationIndex(key) + SEP + indexify(key) + zero; -} +// Preprocess documents, parse their revisions, assign an id and a +// revision for new writes that are missing them, etc +function parseDoc(doc, newEdits) { -function parseNumber(str, i) { - var originalIdx = i; - var num; - var zero = str[i] === '1'; - if (zero) { - num = 0; - i++; - } else { - var neg = str[i] === '0'; - i++; - var numAsString = ''; - var magAsString = str.substring(i, i + MAGNITUDE_DIGITS); - var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE; - /* istanbul ignore next */ - if (neg) { - magnitude = -magnitude; + var nRevNum; + var newRevId; + var revInfo; + var opts = {status: 'available'}; + if (doc._deleted) { + opts.deleted = true; + } + + if (newEdits) { + if (!doc._id) { + doc._id = pouchdbUtils.uuid(); } - i += MAGNITUDE_DIGITS; - while (true) { - var ch = str[i]; - if (ch === '\u0000') { - break; - } else { - numAsString += ch; + newRevId = pouchdbUtils.rev(); + if (doc._rev) { + revInfo = parseRevisionInfo(doc._rev); + if (revInfo.error) { + return revInfo; } - i++; - } - numAsString = numAsString.split('.'); - if (numAsString.length === 1) { - num = parseInt(numAsString, 10); + doc._rev_tree = [{ + pos: revInfo.prefix, + ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]] + }]; + nRevNum = revInfo.prefix + 1; } else { - /* istanbul ignore next */ - num = parseFloat(numAsString[0] + '.' + numAsString[1]); + doc._rev_tree = [{ + pos: 1, + ids : [newRevId, opts, []] + }]; + nRevNum = 1; } - /* istanbul ignore next */ - if (neg) { - num = num - 10; + } else { + if (doc._revisions) { + doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts); + nRevNum = doc._revisions.start; + newRevId = doc._revisions.ids[0]; } - /* istanbul ignore next */ - if (magnitude !== 0) { - // parseFloat is more reliable than pow due to rounding errors - // e.g. Number.MAX_VALUE would return Infinity if we did - // num * Math.pow(10, magnitude); - num = parseFloat(num + 'e' + magnitude); + if (!doc._rev_tree) { + revInfo = parseRevisionInfo(doc._rev); + if (revInfo.error) { + return revInfo; + } + nRevNum = revInfo.prefix; + newRevId = revInfo.id; + doc._rev_tree = [{ + pos: nRevNum, + ids: [newRevId, opts, []] + }]; } } - return {num: num, length : i - originalIdx}; -} - -// move up the stack while parsing -// this function moved outside of parseIndexableString for performance -function pop(stack, metaStack) { - var obj = stack.pop(); - if (metaStack.length) { - var lastMetaElement = metaStack[metaStack.length - 1]; - if (obj === lastMetaElement.element) { - // popping a meta-element, e.g. an object whose value is another object - metaStack.pop(); - lastMetaElement = metaStack[metaStack.length - 1]; - } - var element = lastMetaElement.element; - var lastElementIndex = lastMetaElement.index; - if (Array.isArray(element)) { - element.push(obj); - } else if (lastElementIndex === stack.length - 2) { // obj with key+value - var key = stack.pop(); - element[key] = obj; - } else { - stack.push(obj); // obj with key only - } - } -} + pouchdbUtils.invalidIdError(doc._id); -function parseIndexableString(str) { - var stack = []; - var metaStack = []; // stack for arrays and objects - var i = 0; + doc._rev = nRevNum + '-' + newRevId; - /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ - while (true) { - var collationIndex = str[i++]; - if (collationIndex === '\u0000') { - if (stack.length === 1) { - return stack.pop(); + var result = {metadata : {}, data : {}}; + for (var key in doc) { + /* istanbul ignore else */ + if (Object.prototype.hasOwnProperty.call(doc, key)) { + var specialKey = key[0] === '_'; + if (specialKey && !reservedWords[key]) { + var error = pouchdbErrors.createError(pouchdbErrors.DOC_VALIDATION, key); + error.message = pouchdbErrors.DOC_VALIDATION.message + ': ' + key; + throw error; + } else if (specialKey && !dataWords[key]) { + result.metadata[key.slice(1)] = doc[key]; } else { - pop(stack, metaStack); - continue; + result.data[key] = doc[key]; } } - switch (collationIndex) { - case '1': - stack.push(null); - break; - case '2': - stack.push(str[i] === '1'); - i++; - break; - case '3': - var parsedNum = parseNumber(str, i); - stack.push(parsedNum.num); - i += parsedNum.length; - break; - case '4': - var parsedStr = ''; - /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ - while (true) { - var ch = str[i]; - if (ch === '\u0000') { - break; - } - parsedStr += ch; - i++; - } - // perform the reverse of the order-preserving replacement - // algorithm (see above) - parsedStr = parsedStr.replace(/\u0001\u0001/g, '\u0000') - .replace(/\u0001\u0002/g, '\u0001') - .replace(/\u0002\u0002/g, '\u0002'); - stack.push(parsedStr); - break; - case '5': - var arrayElement = { element: [], index: stack.length }; - stack.push(arrayElement.element); - metaStack.push(arrayElement); - break; - case '6': - var objElement = { element: {}, index: stack.length }; - stack.push(objElement.element); - metaStack.push(objElement); - break; - /* istanbul ignore next */ - default: - throw new Error( - 'bad collationIndex or unexpectedly reached end of input: ' + - collationIndex); - } } + return result; } -function arrayCollate(a, b) { - var len = Math.min(a.length, b.length); - for (var i = 0; i < len; i++) { - var sort = collate(a[i], b[i]); - if (sort !== 0) { - return sort; - } +function parseBase64(data) { + try { + return pouchdbBinaryUtils.atob(data); + } catch (e) { + var err = pouchdbErrors.createError(pouchdbErrors.BAD_ARG, + 'Attachment is not a valid base64 string'); + return {error: err}; } - return (a.length === b.length) ? 0 : - (a.length > b.length) ? 1 : -1; -} -function stringCollate(a, b) { - // See: https://github.com/daleharvey/pouchdb/issues/40 - // This is incompatible with the CouchDB implementation, but its the - // best we can do for now - return (a === b) ? 0 : ((a > b) ? 1 : -1); } -function objectCollate(a, b) { - var ak = Object.keys(a), bk = Object.keys(b); - var len = Math.min(ak.length, bk.length); - for (var i = 0; i < len; i++) { - // First sort the keys - var sort = collate(ak[i], bk[i]); - if (sort !== 0) { - return sort; - } - // if the keys are equal sort the values - sort = collate(a[ak[i]], b[bk[i]]); - if (sort !== 0) { - return sort; - } +function preprocessString(att, blobType, callback) { + var asBinary = parseBase64(att.data); + if (asBinary.error) { + return callback(asBinary.error); } - return (ak.length === bk.length) ? 0 : - (ak.length > bk.length) ? 1 : -1; + + att.length = asBinary.length; + if (blobType === 'blob') { + att.data = pouchdbBinaryUtils.binaryStringToBlobOrBuffer(asBinary, att.content_type); + } else if (blobType === 'base64') { + att.data = pouchdbBinaryUtils.btoa(asBinary); + } else { // binary + att.data = asBinary; + } + pouchdbMd5.binaryMd5(asBinary, function (result) { + att.digest = 'md5-' + result; + callback(); + }); } -// The collation is defined by erlangs ordered terms -// the atoms null, true, false come first, then numbers, strings, -// arrays, then objects -// null/undefined/NaN/Infinity/-Infinity are all considered null -function collationIndex(x) { - var id = ['boolean', 'number', 'string', 'object']; - var idx = id.indexOf(typeof x); - //false if -1 otherwise true, but fast!!!!1 - if (~idx) { - if (x === null) { - return 1; - } - if (Array.isArray(x)) { - return 5; + +function preprocessBlob(att, blobType, callback) { + pouchdbMd5.binaryMd5(att.data, function (md5) { + att.digest = 'md5-' + md5; + // size is for blobs (browser), length is for buffers (node) + att.length = att.data.size || att.data.length || 0; + if (blobType === 'binary') { + pouchdbBinaryUtils.blobOrBufferToBinaryString(att.data, function (binString) { + att.data = binString; + callback(); + }); + } else if (blobType === 'base64') { + pouchdbBinaryUtils.blobOrBufferToBase64(att.data, function (b64) { + att.data = b64; + callback(); + }); + } else { + callback(); } - return idx < 3 ? (idx + 2) : (idx + 3); + }); +} + +function preprocessAttachment(att, blobType, callback) { + if (att.stub) { + return callback(); } - /* istanbul ignore next */ - if (Array.isArray(x)) { - return 5; + if (typeof att.data === 'string') { // input is a base64 string + preprocessString(att, blobType, callback); + } else { // input is a blob + preprocessBlob(att, blobType, callback); } } -// conversion: -// x yyy zz...zz -// x = 0 for negative, 1 for 0, 2 for positive -// y = exponent (for negative numbers negated) moved so that it's >= 0 -// z = mantisse -function numToIndexableString(num) { +function preprocessAttachments(docInfos, blobType, callback) { - if (num === 0) { - return '1'; + if (!docInfos.length) { + return callback(); } - // convert number to exponential format for easier and - // more succinct string sorting - var expFormat = num.toExponential().split(/e\+?/); - var magnitude = parseInt(expFormat[1], 10); - - var neg = num < 0; + var docv = 0; + var overallErr; - var result = neg ? '0' : '2'; + docInfos.forEach(function (docInfo) { + var attachments = docInfo.data && docInfo.data._attachments ? + Object.keys(docInfo.data._attachments) : []; + var recv = 0; - // first sort by magnitude - // it's easier if all magnitudes are positive - var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE); - var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS); + if (!attachments.length) { + return done(); + } - result += SEP + magString; + function processedAttachment(err) { + overallErr = err; + recv++; + if (recv === attachments.length) { + done(); + } + } - // then sort by the factor - var factor = Math.abs(parseFloat(expFormat[0])); // [1..10) - /* istanbul ignore next */ - if (neg) { // for negative reverse ordering - factor = 10 - factor; + for (var key in docInfo.data._attachments) { + if (docInfo.data._attachments.hasOwnProperty(key)) { + preprocessAttachment(docInfo.data._attachments[key], + blobType, processedAttachment); + } + } + }); + + function done() { + docv++; + if (docInfos.length === docv) { + if (overallErr) { + callback(overallErr); + } else { + callback(); + } + } } +} - var factorStr = factor.toFixed(20); +function updateDoc(revLimit, prev, docInfo, results, + i, cb, writeDoc, newEdits) { - // strip zeros from the end - factorStr = factorStr.replace(/\.?0+$/, ''); + if (pouchdbMerge.revExists(prev.rev_tree, docInfo.metadata.rev)) { + results[i] = docInfo; + return cb(); + } - result += SEP + factorStr; + // sometimes this is pre-calculated. historically not always + var previousWinningRev = prev.winningRev || pouchdbMerge.winningRev(prev); + var previouslyDeleted = 'deleted' in prev ? prev.deleted : + pouchdbMerge.isDeleted(prev, previousWinningRev); + var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted : + pouchdbMerge.isDeleted(docInfo.metadata); + var isRoot = /^1-/.test(docInfo.metadata.rev); - return result; -} + if (previouslyDeleted && !deleted && newEdits && isRoot) { + var newDoc = docInfo.data; + newDoc._rev = previousWinningRev; + newDoc._id = docInfo.metadata.id; + docInfo = parseDoc(newDoc, newEdits); + } -exports.collate = collate; -exports.normalizeKey = normalizeKey; -exports.toIndexableString = toIndexableString; -exports.parseIndexableString = parseIndexableString; + var merged = pouchdbMerge.merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit); -},{}],522:[function(require,module,exports){ -'use strict'; + var inConflict = newEdits && (( + (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') || + (!previouslyDeleted && merged.conflicts !== 'new_leaf') || + (previouslyDeleted && !deleted && merged.conflicts === 'new_branch'))); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + if (inConflict) { + var err = pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); + results[i] = err; + return cb(); + } -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbCollections = require('pouchdb-collections'); -var inherits = _interopDefault(require('inherits')); -var Promise = _interopDefault(require('pouchdb-promise')); -var events = require('events'); -var getArguments = _interopDefault(require('argsarray')); -var pouchdbMerge = require('pouchdb-merge'); -var pouchdbErrors = require('pouchdb-errors'); -var pouchDebug = _interopDefault(require('pouchdb-debug')); -var pouchChangesFilter = _interopDefault(require('pouchdb-changes-filter')); + var newRev = docInfo.metadata.rev; + docInfo.metadata.rev_tree = merged.tree; + docInfo.stemmedRevs = merged.stemmedRevs || []; + /* istanbul ignore else */ + if (prev.rev_map) { + docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb + } -inherits(Changes, events.EventEmitter); + // recalculate + var winningRev = pouchdbMerge.winningRev(docInfo.metadata); + var winningRevIsDeleted = pouchdbMerge.isDeleted(docInfo.metadata, winningRev); -function tryCatchInChangeListener(self, change, pending, lastSeq) { - // isolate try/catches to avoid V8 deoptimizations - try { - self.emit('change', change, pending, lastSeq); - } catch (e) { - pouchdbUtils.guardedConsole('error', 'Error in .on("change", function):', e); + // calculate the total number of documents that were added/removed, + // from the perspective of total_rows/doc_count + var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 : + previouslyDeleted < winningRevIsDeleted ? -1 : 1; + + var newRevIsDeleted; + if (newRev === winningRev) { + // if the new rev is the same as the winning rev, we can reuse that value + newRevIsDeleted = winningRevIsDeleted; + } else { + // if they're not the same, then we need to recalculate + newRevIsDeleted = pouchdbMerge.isDeleted(docInfo.metadata, newRev); } + + writeDoc(docInfo, winningRev, winningRevIsDeleted, newRevIsDeleted, + true, delta, i, cb); } -function Changes(db, opts, callback) { - events.EventEmitter.call(this); - var self = this; - this.db = db; - opts = opts ? pouchdbUtils.clone(opts) : {}; - var complete = opts.complete = pouchdbUtils.once(function (err, resp) { - if (err) { - if (pouchdbUtils.listenerCount(self, 'error') > 0) { - self.emit('error', err); - } - } else { - self.emit('complete', resp); +function rootIsMissing(docInfo) { + return docInfo.metadata.rev_tree[0].ids[1].status === 'missing'; +} + +function processDocs(revLimit, docInfos, api, fetchedDocs, tx, results, + writeDoc, opts, overallCallback) { + + // Default to 1000 locally + revLimit = revLimit || 1000; + + function insertDoc(docInfo, resultsIdx, callback) { + // Cant insert new deleted documents + var winningRev = pouchdbMerge.winningRev(docInfo.metadata); + var deleted = pouchdbMerge.isDeleted(docInfo.metadata, winningRev); + if ('was_delete' in opts && deleted) { + results[resultsIdx] = pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, 'deleted'); + return callback(); } - self.removeAllListeners(); - db.removeListener('destroyed', onDestroy); - }); - if (callback) { - self.on('complete', function (resp) { - callback(null, resp); - }); - self.on('error', callback); + + // 4712 - detect whether a new document was inserted with a _rev + var inConflict = newEdits && rootIsMissing(docInfo); + + if (inConflict) { + var err = pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); + results[resultsIdx] = err; + return callback(); + } + + var delta = deleted ? 0 : 1; + + writeDoc(docInfo, winningRev, deleted, deleted, false, + delta, resultsIdx, callback); } - function onDestroy() { - self.cancel(); + + var newEdits = opts.new_edits; + var idsToDocs = new pouchdbCollections.Map(); + + var docsDone = 0; + var docsToDo = docInfos.length; + + function checkAllDocsDone() { + if (++docsDone === docsToDo && overallCallback) { + overallCallback(); + } } - db.once('destroyed', onDestroy); - opts.onChange = function (change, pending, lastSeq) { - /* istanbul ignore if */ - if (self.isCancelled) { + docInfos.forEach(function (currentDoc, resultsIdx) { + + if (currentDoc._id && pouchdbMerge.isLocalId(currentDoc._id)) { + var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal'; + api[fun](currentDoc, {ctx: tx}, function (err, res) { + results[resultsIdx] = err || res; + checkAllDocsDone(); + }); return; } - tryCatchInChangeListener(self, change, pending, lastSeq); - }; - var promise = new Promise(function (fulfill, reject) { - opts.complete = function (err, res) { - if (err) { - reject(err); - } else { - fulfill(res); - } - }; - }); - self.once('cancel', function () { - db.removeListener('destroyed', onDestroy); - opts.complete(null, {status: 'cancelled'}); + var id = currentDoc.metadata.id; + if (idsToDocs.has(id)) { + docsToDo--; // duplicate + idsToDocs.get(id).push([currentDoc, resultsIdx]); + } else { + idsToDocs.set(id, [[currentDoc, resultsIdx]]); + } }); - this.then = promise.then.bind(promise); - this['catch'] = promise['catch'].bind(promise); - this.then(function (result) { - complete(null, result); - }, complete); - + // in the case of new_edits, the user can provide multiple docs + // with the same id. these need to be processed sequentially + idsToDocs.forEach(function (docs, id) { + var numDone = 0; - if (!db.taskqueue.isReady) { - db.taskqueue.addTask(function (failed) { - if (failed) { - opts.complete(failed); - } else if (self.isCancelled) { - self.emit('cancel'); + function docWritten() { + if (++numDone < docs.length) { + nextDoc(); } else { - self.validateChanges(opts); + checkAllDocsDone(); } - }); - } else { - self.validateChanges(opts); - } -} -Changes.prototype.cancel = function () { - this.isCancelled = true; - if (this.db.taskqueue.isReady) { - this.emit('cancel'); - } -}; -function processChange(doc, metadata, opts) { - var changeList = [{rev: doc._rev}]; - if (opts.style === 'all_docs') { - changeList = pouchdbMerge.collectLeaves(metadata.rev_tree) - .map(function (x) { return {rev: x.rev}; }); - } - var change = { - id: metadata.id, - changes: changeList, - doc: doc - }; + } + function nextDoc() { + var value = docs[numDone]; + var currentDoc = value[0]; + var resultsIdx = value[1]; - if (pouchdbMerge.isDeleted(metadata, doc._rev)) { - change.deleted = true; - } - if (opts.conflicts) { - change.doc._conflicts = pouchdbMerge.collectConflicts(metadata); - if (!change.doc._conflicts.length) { - delete change.doc._conflicts; + if (fetchedDocs.has(id)) { + updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results, + resultsIdx, docWritten, writeDoc, newEdits); + } else { + // Ensure stemming applies to new writes as well + var merged = pouchdbMerge.merge([], currentDoc.metadata.rev_tree[0], revLimit); + currentDoc.metadata.rev_tree = merged.tree; + currentDoc.stemmedRevs = merged.stemmedRevs || []; + insertDoc(currentDoc, resultsIdx, docWritten); + } } - } - return change; + nextDoc(); + }); } -Changes.prototype.validateChanges = function (opts) { - var callback = opts.complete; - var self = this; +exports.allDocsKeysQuery = allDocsKeysQuery; +exports.invalidIdError = pouchdbUtils.invalidIdError; +exports.isDeleted = pouchdbMerge.isDeleted; +exports.isLocalId = pouchdbMerge.isLocalId; +exports.normalizeDdocFunctionName = pouchdbUtils.normalizeDdocFunctionName; +exports.parseDdocFunctionName = pouchdbUtils.parseDdocFunctionName; +exports.parseDoc = parseDoc; +exports.preprocessAttachments = preprocessAttachments; +exports.processDocs = processDocs; +exports.updateDoc = updateDoc; - /* istanbul ignore else */ - if (PouchDB$2._changesFilterPlugin) { - PouchDB$2._changesFilterPlugin.validate(opts, function (err) { - if (err) { - return callback(err); - } - self.doChanges(opts); - }); - } else { - self.doChanges(opts); - } -}; +},{"pouchdb-binary-utils":520,"pouchdb-collections":521,"pouchdb-errors":522,"pouchdb-md5":524,"pouchdb-merge":525,"pouchdb-promise":526,"pouchdb-utils":527}],520:[function(require,module,exports){ +arguments[4][507][0].apply(exports,arguments) +},{"dup":507}],521:[function(require,module,exports){ +arguments[4][508][0].apply(exports,arguments) +},{"dup":508}],522:[function(require,module,exports){ +arguments[4][509][0].apply(exports,arguments) +},{"dup":509,"inherits":495}],523:[function(require,module,exports){ +'use strict'; -Changes.prototype.doChanges = function (opts) { - var self = this; - var callback = opts.complete; +Object.defineProperty(exports, '__esModule', { value: true }); - opts = pouchdbUtils.clone(opts); - if ('live' in opts && !('continuous' in opts)) { - opts.continuous = opts.live; - } - opts.processChange = processChange; +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - if (opts.since === 'latest') { - opts.since = 'now'; - } - if (!opts.since) { - opts.since = 0; - } - if (opts.since === 'now') { - this.db.info().then(function (info) { - /* istanbul ignore if */ - if (self.isCancelled) { - callback(null, {status: 'cancelled'}); - return; - } - opts.since = info.update_seq; - self.doChanges(opts); - }, callback); - return; - } +var vuvuzela = _interopDefault(require('vuvuzela')); - /* istanbul ignore else */ - if (PouchDB$2._changesFilterPlugin) { - PouchDB$2._changesFilterPlugin.normalize(opts); - if (PouchDB$2._changesFilterPlugin.shouldFilter(this, opts)) { - return PouchDB$2._changesFilterPlugin.filter(this, opts); - } - } else { - ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) { - if (key in opts) { - pouchdbUtils.guardedConsole('warn', - 'The "' + key + '" option was passed in to changes/replicate, ' + - 'but pouchdb-changes-filter plugin is not installed, so it ' + - 'was ignored. Please install the plugin to enable filtering.' - ); - } - }); +function safeJsonParse(str) { + // This try/catch guards against stack overflow errors. + // JSON.parse() is faster than vuvuzela.parse() but vuvuzela + // cannot overflow. + try { + return JSON.parse(str); + } catch (e) { + /* istanbul ignore next */ + return vuvuzela.parse(str); } +} - if (!('descending' in opts)) { - opts.descending = false; +function safeJsonStringify(json) { + try { + return JSON.stringify(json); + } catch (e) { + /* istanbul ignore next */ + return vuvuzela.stringify(json); } +} - // 0 and 1 should return 1 document - opts.limit = opts.limit === 0 ? 1 : opts.limit; - opts.complete = callback; - var newPromise = this.db._changes(opts); - /* istanbul ignore else */ - if (newPromise && typeof newPromise.cancel === 'function') { - var cancel = self.cancel; - self.cancel = getArguments(function (args) { - newPromise.cancel(); - cancel.apply(this, args); - }); - } -}; +exports.safeJsonParse = safeJsonParse; +exports.safeJsonStringify = safeJsonStringify; -/* - * A generic pouch adapter - */ +},{"vuvuzela":654}],524:[function(require,module,exports){ +(function (global){ +'use strict'; -function compare(left, right) { - return left < right ? -1 : left > right ? 1 : 0; +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var Md5 = _interopDefault(require('spark-md5')); + +var setImmediateShim = global.setImmediate || global.setTimeout; +var MD5_CHUNK_SIZE = 32768; + +function rawToBase64(raw) { + return pouchdbBinaryUtils.btoa(raw); } -// Wrapper for functions that call the bulkdocs api with a single doc, -// if the first result is an error, return an error -function yankError(callback, docId) { - return function (err, results) { - if (err || (results[0] && results[0].error)) { - err = err || results[0]; - err.docId = docId; - callback(err); - } else { - callback(null, results.length ? results[0] : results); - } - }; +function sliceBlob(blob, start, end) { + if (blob.webkitSlice) { + return blob.webkitSlice(start, end); + } + return blob.slice(start, end); } -// clean docs given to us by the user -function cleanDocs(docs) { - for (var i = 0; i < docs.length; i++) { - var doc = docs[i]; - if (doc._deleted) { - delete doc._attachments; // ignore atts for deleted docs - } else if (doc._attachments) { - // filter out extraneous keys from _attachments - var atts = Object.keys(doc._attachments); - for (var j = 0; j < atts.length; j++) { - var att = atts[j]; - doc._attachments[att] = pouchdbUtils.pick(doc._attachments[att], - ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']); - } - } +function appendBlob(buffer, blob, start, end, callback) { + if (start > 0 || end < blob.size) { + // only slice blob if we really need to + blob = sliceBlob(blob, start, end); } + pouchdbBinaryUtils.readAsArrayBuffer(blob, function (arrayBuffer) { + buffer.append(arrayBuffer); + callback(); + }); } -// compare two docs, first by _id then by _rev -function compareByIdThenRev(a, b) { - var idCompare = compare(a._id, b._id); - if (idCompare !== 0) { - return idCompare; +function appendString(buffer, string, start, end, callback) { + if (start > 0 || end < string.length) { + // only create a substring if we really need to + string = string.substring(start, end); } - var aStart = a._revisions ? a._revisions.start : 0; - var bStart = b._revisions ? b._revisions.start : 0; - return compare(aStart, bStart); + buffer.appendBinary(string); + callback(); } -// for every node in a revision tree computes its distance from the closest -// leaf -function computeHeight(revs) { - var height = {}; - var edges = []; - pouchdbMerge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) { - var rev$$1 = pos + "-" + id; - if (isLeaf) { - height[rev$$1] = 0; - } - if (prnt !== undefined) { - edges.push({from: prnt, to: rev$$1}); - } - return rev$$1; - }); +function binaryMd5(data, callback) { + var inputIsString = typeof data === 'string'; + var len = inputIsString ? data.length : data.size; + var chunkSize = Math.min(MD5_CHUNK_SIZE, len); + var chunks = Math.ceil(len / chunkSize); + var currentChunk = 0; + var buffer = inputIsString ? new Md5() : new Md5.ArrayBuffer(); - edges.reverse(); - edges.forEach(function (edge) { - if (height[edge.from] === undefined) { - height[edge.from] = 1 + height[edge.to]; + var append = inputIsString ? appendString : appendBlob; + + function next() { + setImmediateShim(loadNextChunk); + } + + function done() { + var raw = buffer.end(true); + var base64 = rawToBase64(raw); + callback(base64); + buffer.destroy(); + } + + function loadNextChunk() { + var start = currentChunk * chunkSize; + var end = start + chunkSize; + currentChunk++; + if (currentChunk < chunks) { + append(buffer, data, start, end, next); } else { - height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]); + append(buffer, data, start, end, done); } - }); - return height; + } + loadNextChunk(); } -function allDocsKeysParse(opts) { - var keys = ('limit' in opts) ? - opts.keys.slice(opts.skip, opts.limit + opts.skip) : - (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys; - opts.keys = keys; - opts.skip = 0; - if (opts.descending) { - keys.reverse(); - opts.descending = false; - } +function stringMd5(string) { + return Md5.hash(string); } -// all compaction is done in a queue, to avoid attaching -// too many listeners at once -function doNextCompaction(self) { - var task = self._compactionQueue[0]; - var opts = task.opts; - var callback = task.callback; - self.get('_local/compaction').catch(function () { - return false; - }).then(function (doc) { - if (doc && doc.last_seq) { - opts.last_seq = doc.last_seq; - } - self._compact(opts, function (err, res) { - /* istanbul ignore if */ - if (err) { - callback(err); - } else { - callback(null, res); - } - pouchdbUtils.nextTick(function () { - self._compactionQueue.shift(); - if (self._compactionQueue.length) { - doNextCompaction(self); - } - }); - }); - }); -} - -function attachmentNameError(name) { - if (name.charAt(0) === '_') { - return name + ' is not a valid attachment name, attachment ' + - 'names cannot start with \'_\''; - } - return false; -} - -inherits(AbstractPouchDB, events.EventEmitter); +exports.binaryMd5 = binaryMd5; +exports.stringMd5 = stringMd5; -function AbstractPouchDB() { - events.EventEmitter.call(this); -} +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"pouchdb-binary-utils":520,"spark-md5":647}],525:[function(require,module,exports){ +'use strict'; -AbstractPouchDB.prototype.post = - pouchdbUtils.adapterFun('post', function (doc, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - if (typeof doc !== 'object' || Array.isArray(doc)) { - return callback(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); - } - this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id)); -}); +Object.defineProperty(exports, '__esModule', { value: true }); -AbstractPouchDB.prototype.put = pouchdbUtils.adapterFun('put', function (doc, opts, cb) { - if (typeof opts === 'function') { - cb = opts; - opts = {}; - } - if (typeof doc !== 'object' || Array.isArray(doc)) { - return cb(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); - } - pouchdbUtils.invalidIdError(doc._id); - if (pouchdbMerge.isLocalId(doc._id) && typeof this._putLocal === 'function') { - if (doc._deleted) { - return this._removeLocal(doc, cb); - } else { - return this._putLocal(doc, cb); +// We fetch all leafs of the revision tree, and sort them based on tree length +// and whether they were deleted, undeleted documents with the longest revision +// tree (most edits) win +// The final sort algorithm is slightly documented in a sidebar here: +// http://guide.couchdb.org/draft/conflicts.html +function winningRev(metadata) { + var winningId; + var winningPos; + var winningDeleted; + var toVisit = metadata.rev_tree.slice(); + var node; + while ((node = toVisit.pop())) { + var tree = node.ids; + var branches = tree[2]; + var pos = node.pos; + if (branches.length) { // non-leaf + for (var i = 0, len = branches.length; i < len; i++) { + toVisit.push({pos: pos + 1, ids: branches[i]}); + } + continue; + } + var deleted = !!tree[1].deleted; + var id = tree[0]; + // sort by deleted, then pos, then id + if (!winningId || (winningDeleted !== deleted ? winningDeleted : + winningPos !== pos ? winningPos < pos : winningId < id)) { + winningId = id; + winningPos = pos; + winningDeleted = deleted; } - } - var self = this; - if (opts.force && doc._rev) { - transformForceOptionToNewEditsOption(); - putDoc(function (err) { - var result = err ? null : {ok: true, id: doc._id, rev: doc._rev}; - cb(err, result); - }); - } else { - putDoc(cb); } - function transformForceOptionToNewEditsOption() { - var parts = doc._rev.split('-'); - var oldRevId = parts[1]; - var oldRevNum = parseInt(parts[0], 10); + return winningPos + '-' + winningId; +} - var newRevNum = oldRevNum + 1; - var newRevId = pouchdbUtils.rev(); +// Pretty much all below can be combined into a higher order function to +// traverse revisions +// The return value from the callback will be passed as context to all +// children of that node +function traverseRevTree(revs, callback) { + var toVisit = revs.slice(); - doc._revisions = { - start: newRevNum, - ids: [newRevId, oldRevId] - }; - doc._rev = newRevNum + '-' + newRevId; - opts.new_edits = false; - } - function putDoc(next) { - if (typeof self._put === 'function' && opts.new_edits !== false) { - self._put(doc, opts, next); - } else { - self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id)); + var node; + while ((node = toVisit.pop())) { + var pos = node.pos; + var tree = node.ids; + var branches = tree[2]; + var newCtx = + callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]); + for (var i = 0, len = branches.length; i < len; i++) { + toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx}); } } -}); +} -AbstractPouchDB.prototype.putAttachment = - pouchdbUtils.adapterFun('putAttachment', function (docId, attachmentId, rev$$1, - blob, type) { - var api = this; - if (typeof type === 'function') { - type = blob; - blob = rev$$1; - rev$$1 = null; - } - // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267 - /* istanbul ignore if */ - if (typeof type === 'undefined') { - type = blob; - blob = rev$$1; - rev$$1 = null; - } - if (!type) { - pouchdbUtils.guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type'); - } +function sortByPos(a, b) { + return a.pos - b.pos; +} - function createAttachment(doc) { - var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0; - doc._attachments = doc._attachments || {}; - doc._attachments[attachmentId] = { - content_type: type, - data: blob, - revpos: ++prevrevpos - }; - return api.put(doc); +function collectLeaves(revs) { + var leaves = []; + traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) { + if (isLeaf) { + leaves.push({rev: pos + "-" + id, pos: pos, opts: opts}); + } + }); + leaves.sort(sortByPos).reverse(); + for (var i = 0, len = leaves.length; i < len; i++) { + delete leaves[i].pos; } + return leaves; +} - return api.get(docId).then(function (doc) { - if (doc._rev !== rev$$1) { - throw pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); +// returns revs of all conflicts that is leaves such that +// 1. are not deleted and +// 2. are different than winning revision +function collectConflicts(metadata) { + var win = winningRev(metadata); + var leaves = collectLeaves(metadata.rev_tree); + var conflicts = []; + for (var i = 0, len = leaves.length; i < len; i++) { + var leaf = leaves[i]; + if (leaf.rev !== win && !leaf.opts.deleted) { + conflicts.push(leaf.rev); } + } + return conflicts; +} - return createAttachment(doc); - }, function (err) { - // create new doc - /* istanbul ignore else */ - if (err.reason === pouchdbErrors.MISSING_DOC.message) { - return createAttachment({_id: docId}); - } else { - throw err; +// compact a tree by marking its non-leafs as missing, +// and return a list of revs to delete +function compactTree(metadata) { + var revs = []; + traverseRevTree(metadata.rev_tree, function (isLeaf, pos, + revHash, ctx, opts) { + if (opts.status === 'available' && !isLeaf) { + revs.push(pos + '-' + revHash); + opts.status = 'missing'; } }); -}); + return revs; +} -AbstractPouchDB.prototype.removeAttachment = - pouchdbUtils.adapterFun('removeAttachment', function (docId, attachmentId, rev$$1, - callback) { - var self = this; - self.get(docId, function (err, obj) { - /* istanbul ignore if */ - if (err) { - callback(err); - return; - } - if (obj._rev !== rev$$1) { - callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); - return; - } - /* istanbul ignore if */ - if (!obj._attachments) { - return callback(); - } - delete obj._attachments[attachmentId]; - if (Object.keys(obj._attachments).length === 0) { - delete obj._attachments; - } - self.put(obj, callback); - }); -}); +// build up a list of all the paths to the leafs in this revision tree +function rootToLeaf(revs) { + var paths = []; + var toVisit = revs.slice(); + var node; + while ((node = toVisit.pop())) { + var pos = node.pos; + var tree = node.ids; + var id = tree[0]; + var opts = tree[1]; + var branches = tree[2]; + var isLeaf = branches.length === 0; -AbstractPouchDB.prototype.remove = - pouchdbUtils.adapterFun('remove', function (docOrId, optsOrRev, opts, callback) { - var doc; - if (typeof optsOrRev === 'string') { - // id, rev, opts, callback style - doc = { - _id: docOrId, - _rev: optsOrRev - }; - if (typeof opts === 'function') { - callback = opts; - opts = {}; + var history = node.history ? node.history.slice() : []; + history.push({id: id, opts: opts}); + if (isLeaf) { + paths.push({pos: (pos + 1 - history.length), ids: history}); } - } else { - // doc, opts, callback style - doc = docOrId; - if (typeof optsOrRev === 'function') { - callback = optsOrRev; - opts = {}; - } else { - callback = opts; - opts = optsOrRev; + for (var i = 0, len = branches.length; i < len; i++) { + toVisit.push({pos: pos + 1, ids: branches[i], history: history}); } } - opts = opts || {}; - opts.was_delete = true; - var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)}; - newDoc._deleted = true; - if (pouchdbMerge.isLocalId(newDoc._id) && typeof this._removeLocal === 'function') { - return this._removeLocal(doc, callback); - } - this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id)); -}); + return paths.reverse(); +} -AbstractPouchDB.prototype.revsDiff = - pouchdbUtils.adapterFun('revsDiff', function (req, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - var ids = Object.keys(req); +// for a better overview of what this is doing, read: +// https://github.com/apache/couchdb-couch/blob/master/src/couch_key_tree.erl +// +// But for a quick intro, CouchDB uses a revision tree to store a documents +// history, A -> B -> C, when a document has conflicts, that is a branch in the +// tree, A -> (B1 | B2 -> C), We store these as a nested array in the format +// +// KeyTree = [Path ... ] +// Path = {pos: position_from_root, ids: Tree} +// Tree = [Key, Opts, [Tree, ...]], in particular single node: [Key, []] - if (!ids.length) { - return callback(null, {}); +function sortByPos$1(a, b) { + return a.pos - b.pos; +} + +// classic binary search +function binarySearch(arr, item, comparator) { + var low = 0; + var high = arr.length; + var mid; + while (low < high) { + mid = (low + high) >>> 1; + if (comparator(arr[mid], item) < 0) { + low = mid + 1; + } else { + high = mid; + } } + return low; +} - var count = 0; - var missing = new pouchdbCollections.Map(); +// assuming the arr is sorted, insert the item in the proper place +function insertSorted(arr, item, comparator) { + var idx = binarySearch(arr, item, comparator); + arr.splice(idx, 0, item); +} - function addToMissing(id, revId) { - if (!missing.has(id)) { - missing.set(id, {missing: []}); +// Turn a path as a flat array into a tree with a single branch. +// If any should be stemmed from the beginning of the array, that's passed +// in as the second argument +function pathToTree(path, numStemmed) { + var root; + var leaf; + for (var i = numStemmed, len = path.length; i < len; i++) { + var node = path[i]; + var currentLeaf = [node.id, node.opts, []]; + if (leaf) { + leaf[2].push(currentLeaf); + leaf = currentLeaf; + } else { + root = leaf = currentLeaf; } - missing.get(id).missing.push(revId); } + return root; +} - function processDoc(id, rev_tree) { - // Is this fast enough? Maybe we should switch to a set simulated by a map - var missingForId = req[id].slice(0); - pouchdbMerge.traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx, - opts) { - var rev$$1 = pos + '-' + revHash; - var idx = missingForId.indexOf(rev$$1); - if (idx === -1) { - return; - } +// compare the IDs of two trees +function compareTree(a, b) { + return a[0] < b[0] ? -1 : 1; +} - missingForId.splice(idx, 1); - /* istanbul ignore if */ - if (opts.status !== 'available') { - addToMissing(id, rev$$1); - } - }); +// Merge two trees together +// The roots of tree1 and tree2 must be the same revision +function mergeTree(in_tree1, in_tree2) { + var queue = [{tree1: in_tree1, tree2: in_tree2}]; + var conflicts = false; + while (queue.length > 0) { + var item = queue.pop(); + var tree1 = item.tree1; + var tree2 = item.tree2; - // Traversing the tree is synchronous, so now `missingForId` contains - // revisions that were not found in the tree - missingForId.forEach(function (rev$$1) { - addToMissing(id, rev$$1); - }); - } + if (tree1[1].status || tree2[1].status) { + tree1[1].status = + (tree1[1].status === 'available' || + tree2[1].status === 'available') ? 'available' : 'missing'; + } - ids.map(function (id) { - this._getRevisionTree(id, function (err, rev_tree) { - if (err && err.status === 404 && err.message === 'missing') { - missing.set(id, {missing: req[id]}); - } else if (err) { - /* istanbul ignore next */ - return callback(err); - } else { - processDoc(id, rev_tree); + for (var i = 0; i < tree2[2].length; i++) { + if (!tree1[2][0]) { + conflicts = 'new_leaf'; + tree1[2][0] = tree2[2][i]; + continue; } - if (++count === ids.length) { - // convert LazyMap to object - var missingObj = {}; - missing.forEach(function (value, key) { - missingObj[key] = value; - }); - return callback(null, missingObj); + var merged = false; + for (var j = 0; j < tree1[2].length; j++) { + if (tree1[2][j][0] === tree2[2][i][0]) { + queue.push({tree1: tree1[2][j], tree2: tree2[2][i]}); + merged = true; + } } - }); - }, this); -}); - -// _bulk_get API for faster replication, as described in -// https://github.com/apache/couchdb-chttpd/pull/33 -// At the "abstract" level, it will just run multiple get()s in -// parallel, because this isn't much of a performance cost -// for local databases (except the cost of multiple transactions, which is -// small). The http adapter overrides this in order -// to do a more efficient single HTTP request. -AbstractPouchDB.prototype.bulkGet = - pouchdbUtils.adapterFun('bulkGet', function (opts, callback) { - pouchdbUtils.bulkGetShim(this, opts, callback); -}); - -// compact one document and fire callback -// by compacting we mean removing all revisions which -// are further from the leaf in revision tree than max_height -AbstractPouchDB.prototype.compactDocument = - pouchdbUtils.adapterFun('compactDocument', function (docId, maxHeight, callback) { - var self = this; - this._getRevisionTree(docId, function (err, revTree) { - /* istanbul ignore if */ - if (err) { - return callback(err); - } - var height = computeHeight(revTree); - var candidates = []; - var revs = []; - Object.keys(height).forEach(function (rev$$1) { - if (height[rev$$1] > maxHeight) { - candidates.push(rev$$1); + if (!merged) { + conflicts = 'new_branch'; + insertSorted(tree1[2], tree2[2][i], compareTree); } - }); + } + } + return {conflicts: conflicts, tree: in_tree1}; +} - pouchdbMerge.traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) { - var rev$$1 = pos + '-' + revHash; - if (opts.status === 'available' && candidates.indexOf(rev$$1) !== -1) { - revs.push(rev$$1); - } - }); - self._doCompaction(docId, revs, callback); - }); -}); +function doMerge(tree, path, dontExpand) { + var restree = []; + var conflicts = false; + var merged = false; + var res; -// compact the whole database using single document -// compaction -AbstractPouchDB.prototype.compact = - pouchdbUtils.adapterFun('compact', function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; + if (!tree.length) { + return {tree: [path], conflicts: 'new_leaf'}; } - var self = this; - opts = opts || {}; + for (var i = 0, len = tree.length; i < len; i++) { + var branch = tree[i]; + if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) { + // Paths start at the same position and have the same root, so they need + // merged + res = mergeTree(branch.ids, path.ids); + restree.push({pos: branch.pos, ids: res.tree}); + conflicts = conflicts || res.conflicts; + merged = true; + } else if (dontExpand !== true) { + // The paths start at a different position, take the earliest path and + // traverse up until it as at the same point from root as the path we + // want to merge. If the keys match we return the longer path with the + // other merged After stemming we dont want to expand the trees - self._compactionQueue = self._compactionQueue || []; - self._compactionQueue.push({opts: opts, callback: callback}); - if (self._compactionQueue.length === 1) { - doNextCompaction(self); - } -}); -AbstractPouchDB.prototype._compact = function (opts, callback) { - var self = this; - var changesOpts = { - return_docs: false, - last_seq: opts.last_seq || 0 - }; - var promises = []; + var t1 = branch.pos < path.pos ? branch : path; + var t2 = branch.pos < path.pos ? path : branch; + var diff = t2.pos - t1.pos; - function onChange(row) { - promises.push(self.compactDocument(row.id, 0)); - } - function onComplete(resp) { - var lastSeq = resp.last_seq; - Promise.all(promises).then(function () { - return pouchdbUtils.upsert(self, '_local/compaction', function deltaFunc(doc) { - if (!doc.last_seq || doc.last_seq < lastSeq) { - doc.last_seq = lastSeq; - return doc; - } - return false; // somebody else got here first, don't update - }); - }).then(function () { - callback(null, {ok: true}); - }).catch(callback); - } - self.changes(changesOpts) - .on('change', onChange) - .on('complete', onComplete) - .on('error', callback); -}; - -/* Begin api wrappers. Specific functionality to storage belongs in the - _[method] */ -AbstractPouchDB.prototype.get = pouchdbUtils.adapterFun('get', function (id, opts, cb) { - if (typeof opts === 'function') { - cb = opts; - opts = {}; - } - if (typeof id !== 'string') { - return cb(pouchdbErrors.createError(pouchdbErrors.INVALID_ID)); - } - if (pouchdbMerge.isLocalId(id) && typeof this._getLocal === 'function') { - return this._getLocal(id, cb); - } - var leaves = [], self = this; - - function finishOpenRevs() { - var result = []; - var count = leaves.length; - /* istanbul ignore if */ - if (!count) { - return cb(null, result); - } + var candidateParents = []; - // order with open_revs is unspecified - leaves.forEach(function (leaf) { - self.get(id, { - rev: leaf, - revs: opts.revs, - latest: opts.latest, - attachments: opts.attachments, - binary: opts.binary - }, function (err, doc) { - if (!err) { - // using latest=true can produce duplicates - var existing; - for (var i = 0, l = result.length; i < l; i++) { - if (result[i].ok && result[i].ok._rev === doc._rev) { - existing = true; - break; - } - } - if (!existing) { - result.push({ok: doc}); + var trees = []; + trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null}); + while (trees.length > 0) { + var item = trees.pop(); + if (item.diff === 0) { + if (item.ids[0] === t2.ids[0]) { + candidateParents.push(item); } - } else { - result.push({missing: leaf}); - } - count--; - if (!count) { - cb(null, result); - } - }); - }); - } - - if (opts.open_revs) { - if (opts.open_revs === "all") { - this._getRevisionTree(id, function (err, rev_tree) { - if (err) { - return cb(err); + continue; } - leaves = pouchdbMerge.collectLeaves(rev_tree).map(function (leaf) { - return leaf.rev; - }); - finishOpenRevs(); - }); - } else { - if (Array.isArray(opts.open_revs)) { - leaves = opts.open_revs; - for (var i = 0; i < leaves.length; i++) { - var l = leaves[i]; - // looks like it's the only thing couchdb checks - if (!(typeof (l) === "string" && /^\d+-/.test(l))) { - return cb(pouchdbErrors.createError(pouchdbErrors.INVALID_REV)); - } + var elements = item.ids[2]; + for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) { + trees.push({ + ids: elements[j], + diff: item.diff - 1, + parent: item.ids, + parentIdx: j + }); } - finishOpenRevs(); - } else { - return cb(pouchdbErrors.createError(pouchdbErrors.UNKNOWN_ERROR, 'function_clause')); } - } - return; // open_revs does not like other options - } - - return this._get(id, opts, function (err, result) { - if (err) { - err.docId = id; - return cb(err); - } - var doc = result.doc; - var metadata = result.metadata; - var ctx = result.ctx; + var el = candidateParents[0]; - if (opts.conflicts) { - var conflicts = pouchdbMerge.collectConflicts(metadata); - if (conflicts.length) { - doc._conflicts = conflicts; + if (!el) { + restree.push(branch); + } else { + res = mergeTree(el.ids, t2.ids); + el.parent[2][el.parentIdx] = res.tree; + restree.push({pos: t1.pos, ids: t1.ids}); + conflicts = conflicts || res.conflicts; + merged = true; } + } else { + restree.push(branch); } + } - if (pouchdbMerge.isDeleted(metadata, doc._rev)) { - doc._deleted = true; - } + // We didnt find + if (!merged) { + restree.push(path); + } - if (opts.revs || opts.revs_info) { - var splittedRev = doc._rev.split('-'); - var revNo = parseInt(splittedRev[0], 10); - var revHash = splittedRev[1]; + restree.sort(sortByPos$1); - var paths = pouchdbMerge.rootToLeaf(metadata.rev_tree); - var path = null; + return { + tree: restree, + conflicts: conflicts || 'internal_node' + }; +} - for (var i = 0; i < paths.length; i++) { - var currentPath = paths[i]; - var hashIndex = currentPath.ids.map(function (x) { return x.id; }) - .indexOf(revHash); - var hashFoundAtRevPos = hashIndex === (revNo - 1); +// To ensure we dont grow the revision tree infinitely, we stem old revisions +function stem(tree, depth) { + // First we break out the tree into a complete list of root to leaf paths + var paths = rootToLeaf(tree); + var stemmedRevs; - if (hashFoundAtRevPos || (!path && hashIndex !== -1)) { - path = currentPath; - } + var result; + for (var i = 0, len = paths.length; i < len; i++) { + // Then for each path, we cut off the start of the path based on the + // `depth` to stem to, and generate a new set of flat trees + var path = paths[i]; + var stemmed = path.ids; + var node; + if (stemmed.length > depth) { + // only do the stemming work if we actually need to stem + if (!stemmedRevs) { + stemmedRevs = {}; // avoid allocating this object unnecessarily } + var numStemmed = stemmed.length - depth; + node = { + pos: path.pos + numStemmed, + ids: pathToTree(stemmed, numStemmed) + }; - var indexOfRev = path.ids.map(function (x) { return x.id; }) - .indexOf(doc._rev.split('-')[1]) + 1; - var howMany = path.ids.length - indexOfRev; - path.ids.splice(indexOfRev, howMany); - path.ids.reverse(); - - if (opts.revs) { - doc._revisions = { - start: (path.pos + path.ids.length) - 1, - ids: path.ids.map(function (rev$$1) { - return rev$$1.id; - }) - }; - } - if (opts.revs_info) { - var pos = path.pos + path.ids.length; - doc._revs_info = path.ids.map(function (rev$$1) { - pos--; - return { - rev: pos + '-' + rev$$1.id, - status: rev$$1.opts.status - }; - }); + for (var s = 0; s < numStemmed; s++) { + var rev = (path.pos + s) + '-' + stemmed[s].id; + stemmedRevs[rev] = true; } + } else { // no need to actually stem + node = { + pos: path.pos, + ids: pathToTree(stemmed, 0) + }; } - if (opts.attachments && doc._attachments) { - var attachments = doc._attachments; - var count = Object.keys(attachments).length; - if (count === 0) { - return cb(null, doc); - } - Object.keys(attachments).forEach(function (key) { - this._getAttachment(doc._id, key, attachments[key], { - // Previously the revision handling was done in adapter.js - // getAttachment, however since idb-next doesnt we need to - // pass the rev through - rev: doc._rev, - binary: opts.binary, - ctx: ctx - }, function (err, data) { - var att = doc._attachments[key]; - att.data = data; - delete att.stub; - delete att.length; - if (!--count) { - cb(null, doc); - } - }); - }, self); + // Then we remerge all those flat trees together, ensuring that we dont + // connect trees that would go beyond the depth limit + if (result) { + result = doMerge(result, node, true).tree; } else { - if (doc._attachments) { - for (var key in doc._attachments) { - /* istanbul ignore else */ - if (doc._attachments.hasOwnProperty(key)) { - doc._attachments[key].stub = true; - } - } - } - cb(null, doc); + result = [node]; } - }); -}); - -// TODO: I dont like this, it forces an extra read for every -// attachment read and enforces a confusing api between -// adapter.js and the adapter implementation -AbstractPouchDB.prototype.getAttachment = - pouchdbUtils.adapterFun('getAttachment', function (docId, attachmentId, opts, callback) { - var self = this; - if (opts instanceof Function) { - callback = opts; - opts = {}; } - this._get(docId, opts, function (err, res) { - if (err) { - return callback(err); - } - if (res.doc._attachments && res.doc._attachments[attachmentId]) { - opts.ctx = res.ctx; - opts.binary = true; - self._getAttachment(docId, attachmentId, - res.doc._attachments[attachmentId], opts, callback); - } else { - return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); - } - }); -}); -AbstractPouchDB.prototype.allDocs = - pouchdbUtils.adapterFun('allDocs', function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0; - if (opts.start_key) { - opts.startkey = opts.start_key; - } - if (opts.end_key) { - opts.endkey = opts.end_key; - } - if ('keys' in opts) { - if (!Array.isArray(opts.keys)) { - return callback(new TypeError('options.keys must be an array')); - } - var incompatibleOpt = - ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) { - return incompatibleOpt in opts; - })[0]; - if (incompatibleOpt) { - callback(pouchdbErrors.createError(pouchdbErrors.QUERY_PARSE_ERROR, - 'Query parameter `' + incompatibleOpt + - '` is not compatible with multi-get' - )); - return; - } - if (!pouchdbUtils.isRemote(this)) { - allDocsKeysParse(opts); - if (opts.keys.length === 0) { - return this._allDocs({limit: 0}, callback); - } - } + // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed + if (stemmedRevs) { + traverseRevTree(result, function (isLeaf, pos, revHash) { + // some revisions may have been removed in a branch but not in another + delete stemmedRevs[pos + '-' + revHash]; + }); } - return this._allDocs(opts, callback); -}); + return { + tree: result, + revs: stemmedRevs ? Object.keys(stemmedRevs) : [] + }; +} -AbstractPouchDB.prototype.changes = function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - return new Changes(this, opts, callback); -}; +function merge(tree, path, depth) { + var newTree = doMerge(tree, path); + var stemmed = stem(newTree.tree, depth); + return { + tree: stemmed.tree, + stemmedRevs: stemmed.revs, + conflicts: newTree.conflicts + }; +} -AbstractPouchDB.prototype.close = pouchdbUtils.adapterFun('close', function (callback) { - this._closed = true; - this.emit('closed'); - return this._close(callback); -}); +// return true if a rev exists in the rev tree, false otherwise +function revExists(revs, rev) { + var toVisit = revs.slice(); + var splitRev = rev.split('-'); + var targetPos = parseInt(splitRev[0], 10); + var targetId = splitRev[1]; -AbstractPouchDB.prototype.info = pouchdbUtils.adapterFun('info', function (callback) { - var self = this; - this._info(function (err, info) { - if (err) { - return callback(err); + var node; + while ((node = toVisit.pop())) { + if (node.pos === targetPos && node.ids[0] === targetId) { + return true; } - // assume we know better than the adapter, unless it informs us - info.db_name = info.db_name || self.name; - info.auto_compaction = !!(self.auto_compaction && !pouchdbUtils.isRemote(self)); - info.adapter = self.adapter; - callback(null, info); - }); -}); - -AbstractPouchDB.prototype.id = pouchdbUtils.adapterFun('id', function (callback) { - return this._id(callback); -}); - -/* istanbul ignore next */ -AbstractPouchDB.prototype.type = function () { - return (typeof this._type === 'function') ? this._type() : this.adapter; -}; - -AbstractPouchDB.prototype.bulkDocs = - pouchdbUtils.adapterFun('bulkDocs', function (req, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - - opts = opts || {}; - - if (Array.isArray(req)) { - req = { - docs: req - }; - } - - if (!req || !req.docs || !Array.isArray(req.docs)) { - return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_BULK_DOCS)); - } - - for (var i = 0; i < req.docs.length; ++i) { - if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) { - return callback(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); + var branches = node.ids[2]; + for (var i = 0, len = branches.length; i < len; i++) { + toVisit.push({pos: node.pos + 1, ids: branches[i]}); } } + return false; +} - var attachmentError; - req.docs.forEach(function (doc) { - if (doc._attachments) { - Object.keys(doc._attachments).forEach(function (name) { - attachmentError = attachmentError || attachmentNameError(name); - if (!doc._attachments[name].content_type) { - pouchdbUtils.guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type'); - } - }); - } - }); +function getTrees(node) { + return node.ids; +} - if (attachmentError) { - return callback(pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, attachmentError)); +// check if a specific revision of a doc has been deleted +// - metadata: the metadata object from the doc store +// - rev: (optional) the revision to check. defaults to winning revision +function isDeleted(metadata, rev) { + if (!rev) { + rev = winningRev(metadata); } + var id = rev.substring(rev.indexOf('-') + 1); + var toVisit = metadata.rev_tree.map(getTrees); - if (!('new_edits' in opts)) { - if ('new_edits' in req) { - opts.new_edits = req.new_edits; - } else { - opts.new_edits = true; + var tree; + while ((tree = toVisit.pop())) { + if (tree[0] === id) { + return !!tree[1].deleted; } + toVisit = toVisit.concat(tree[2]); } +} - var adapter = this; - if (!opts.new_edits && !pouchdbUtils.isRemote(adapter)) { - // ensure revisions of the same doc are sorted, so that - // the local adapter processes them correctly (#2935) - req.docs.sort(compareByIdThenRev); - } +function isLocalId(id) { + return (/^_local/).test(id); +} - cleanDocs(req.docs); +// returns the current leaf node for a given revision +function latest(rev, metadata) { + var toVisit = metadata.rev_tree.slice(); + var node; + while ((node = toVisit.pop())) { + var pos = node.pos; + var tree = node.ids; + var id = tree[0]; + var opts = tree[1]; + var branches = tree[2]; + var isLeaf = branches.length === 0; - // in the case of conflicts, we want to return the _ids to the user - // however, the underlying adapter may destroy the docs array, so - // create a copy here - var ids = req.docs.map(function (doc) { - return doc._id; - }); + var history = node.history ? node.history.slice() : []; + history.push({id: id, pos: pos, opts: opts}); - return this._bulkDocs(req, opts, function (err, res) { - if (err) { - return callback(err); - } - if (!opts.new_edits) { - // this is what couch does when new_edits is false - res = res.filter(function (x) { - return x.error; - }); - } - // add ids for error/conflict responses (not required for CouchDB) - if (!pouchdbUtils.isRemote(adapter)) { - for (var i = 0, l = res.length; i < l; i++) { - res[i].id = res[i].id || ids[i]; + if (isLeaf) { + for (var i = 0, len = history.length; i < len; i++) { + var historyNode = history[i]; + var historyRev = historyNode.pos + '-' + historyNode.id; + + if (historyRev === rev) { + // return the rev of this leaf + return pos + '-' + id; + } } } - callback(null, res); - }); -}); - -AbstractPouchDB.prototype.registerDependentDatabase = - pouchdbUtils.adapterFun('registerDependentDatabase', function (dependentDb, - callback) { - var depDB = new this.constructor(dependentDb, this.__opts); - - function diffFun(doc) { - doc.dependentDbs = doc.dependentDbs || {}; - if (doc.dependentDbs[dependentDb]) { - return false; // no update required + for (var j = 0, l = branches.length; j < l; j++) { + toVisit.push({pos: pos + 1, ids: branches[j], history: history}); } - doc.dependentDbs[dependentDb] = true; - return doc; } - pouchdbUtils.upsert(this, '_local/_pouch_dependentDbs', diffFun) - .then(function () { - callback(null, {db: depDB}); - }).catch(callback); -}); -AbstractPouchDB.prototype.destroy = - pouchdbUtils.adapterFun('destroy', function (opts, callback) { + /* istanbul ignore next */ + throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev); +} - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } +exports.collectConflicts = collectConflicts; +exports.collectLeaves = collectLeaves; +exports.compactTree = compactTree; +exports.isDeleted = isDeleted; +exports.isLocalId = isLocalId; +exports.merge = merge; +exports.revExists = revExists; +exports.rootToLeaf = rootToLeaf; +exports.traverseRevTree = traverseRevTree; +exports.winningRev = winningRev; +exports.latest = latest; - var self = this; - var usePrefix = 'use_prefix' in self ? self.use_prefix : true; +},{}],526:[function(require,module,exports){ +arguments[4][510][0].apply(exports,arguments) +},{"dup":510,"lie":500}],527:[function(require,module,exports){ +arguments[4][511][0].apply(exports,arguments) +},{"argsarray":39,"dup":511,"events":491,"immediate":518,"inherits":495,"pouchdb-collections":521,"pouchdb-errors":522,"pouchdb-promise":526,"uuid":528}],528:[function(require,module,exports){ +arguments[4][512][0].apply(exports,arguments) +},{"./v1":531,"./v4":532,"dup":512}],529:[function(require,module,exports){ +arguments[4][513][0].apply(exports,arguments) +},{"dup":513}],530:[function(require,module,exports){ +arguments[4][514][0].apply(exports,arguments) +},{"dup":514}],531:[function(require,module,exports){ +arguments[4][515][0].apply(exports,arguments) +},{"./lib/bytesToUuid":529,"./lib/rng":530,"dup":515}],532:[function(require,module,exports){ +arguments[4][516][0].apply(exports,arguments) +},{"./lib/bytesToUuid":529,"./lib/rng":530,"dup":516}],533:[function(require,module,exports){ +'use strict'; - function destroyDb() { - // call destroy method of the particular adaptor - self._destroy(opts, function (err, resp) { - if (err) { - return callback(err); - } - self._destroyed = true; - self.emit('destroyed'); - callback(null, resp || { 'ok': true }); - }); - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - if (pouchdbUtils.isRemote(self)) { - // no need to check for dependent DBs if it's a remote DB - return destroyDb(); +var Promise = _interopDefault(require('pouchdb-promise')); +var getArguments = _interopDefault(require('argsarray')); +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbMerge = require('pouchdb-merge'); +var inherits = _interopDefault(require('inherits')); +var events = require('events'); +var pouchdbCollections = require('pouchdb-collections'); +var pouchdbErrors = require('pouchdb-errors'); +var pouchDebug = _interopDefault(require('pouchdb-debug')); +var pouchChangesFilter = _interopDefault(require('pouchdb-changes-filter')); + +inherits(Changes, events.EventEmitter); + +function tryCatchInChangeListener(self, change, pending, lastSeq) { + // isolate try/catches to avoid V8 deoptimizations + try { + self.emit('change', change, pending, lastSeq); + } catch (e) { + pouchdbUtils.guardedConsole('error', 'Error in .on("change", function):', e); } +} - self.get('_local/_pouch_dependentDbs', function (err, localDoc) { +function Changes(db, opts, callback) { + events.EventEmitter.call(this); + var self = this; + this.db = db; + opts = opts ? pouchdbUtils.clone(opts) : {}; + var complete = opts.complete = pouchdbUtils.once(function (err, resp) { if (err) { - /* istanbul ignore if */ - if (err.status !== 404) { - return callback(err); - } else { // no dependencies - return destroyDb(); + if (pouchdbUtils.listenerCount(self, 'error') > 0) { + self.emit('error', err); } + } else { + self.emit('complete', resp); } - var dependentDbs = localDoc.dependentDbs; - var PouchDB = self.constructor; - var deletedMap = Object.keys(dependentDbs).map(function (name) { - // use_prefix is only false in the browser - /* istanbul ignore next */ - var trueName = usePrefix ? - name.replace(new RegExp('^' + PouchDB.prefix), '') : name; - return new PouchDB(trueName, self.__opts).destroy(); - }); - Promise.all(deletedMap).then(destroyDb, callback); + self.removeAllListeners(); + db.removeListener('destroyed', onDestroy); }); -}); - -function TaskQueue$1() { - this.isReady = false; - this.failed = false; - this.queue = []; -} - -TaskQueue$1.prototype.execute = function () { - var fun; - if (this.failed) { - while ((fun = this.queue.shift())) { - fun(this.failed); - } - } else { - while ((fun = this.queue.shift())) { - fun(); - } - } -}; - -TaskQueue$1.prototype.fail = function (err) { - this.failed = err; - this.execute(); -}; - -TaskQueue$1.prototype.ready = function (db) { - this.isReady = true; - this.db = db; - this.execute(); -}; - -TaskQueue$1.prototype.addTask = function (fun) { - this.queue.push(fun); - if (this.failed) { - this.execute(); + if (callback) { + self.on('complete', function (resp) { + callback(null, resp); + }); + self.on('error', callback); } -}; - -function parseAdapter(name, opts) { - var match = name.match(/([a-z-]*):\/\/(.*)/); - if (match) { - // the http adapter expects the fully qualified name - return { - name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2], - adapter: match[1] - }; + function onDestroy() { + self.cancel(); } + db.once('destroyed', onDestroy); - var adapters = PouchDB$2.adapters; - var preferredAdapters = PouchDB$2.preferredAdapters; - var prefix = PouchDB$2.prefix; - var adapterName = opts.adapter; + opts.onChange = function (change, pending, lastSeq) { + /* istanbul ignore if */ + if (self.isCancelled) { + return; + } + tryCatchInChangeListener(self, change, pending, lastSeq); + }; - if (!adapterName) { // automatically determine adapter - for (var i = 0; i < preferredAdapters.length; ++i) { - adapterName = preferredAdapters[i]; - // check for browsers that have been upgraded from websql-only to websql+idb - /* istanbul ignore if */ - if (adapterName === 'idb' && 'websql' in adapters && - pouchdbUtils.hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) { - // log it, because this can be confusing during development - pouchdbUtils.guardedConsole('log', 'PouchDB is downgrading "' + name + '" to WebSQL to' + - ' avoid data loss, because it was already opened with WebSQL.'); - continue; // keep using websql to avoid user data loss + var promise = new Promise(function (fulfill, reject) { + opts.complete = function (err, res) { + if (err) { + reject(err); + } else { + fulfill(res); } - break; - } - } + }; + }); + self.once('cancel', function () { + db.removeListener('destroyed', onDestroy); + opts.complete(null, {status: 'cancelled'}); + }); + this.then = promise.then.bind(promise); + this['catch'] = promise['catch'].bind(promise); + this.then(function (result) { + complete(null, result); + }, complete); - var adapter = adapters[adapterName]; - // if adapter is invalid, then an error will be thrown later - var usePrefix = (adapter && 'use_prefix' in adapter) ? - adapter.use_prefix : true; - return { - name: usePrefix ? (prefix + name) : name, - adapter: adapterName - }; + if (!db.taskqueue.isReady) { + db.taskqueue.addTask(function (failed) { + if (failed) { + opts.complete(failed); + } else if (self.isCancelled) { + self.emit('cancel'); + } else { + self.validateChanges(opts); + } + }); + } else { + self.validateChanges(opts); + } } - -// OK, so here's the deal. Consider this code: -// var db1 = new PouchDB('foo'); -// var db2 = new PouchDB('foo'); -// db1.destroy(); -// ^ these two both need to emit 'destroyed' events, -// as well as the PouchDB constructor itself. -// So we have one db object (whichever one got destroy() called on it) -// responsible for emitting the initial event, which then gets emitted -// by the constructor, which then broadcasts it to any other dbs -// that may have been created with the same name. -function prepareForDestruction(self) { - - function onDestroyed(from_constructor) { - self.removeListener('closed', onClosed); - if (!from_constructor) { - self.constructor.emit('destroyed', self.name); - } +Changes.prototype.cancel = function () { + this.isCancelled = true; + if (this.db.taskqueue.isReady) { + this.emit('cancel'); } - - function onClosed() { - self.removeListener('destroyed', onDestroyed); - self.constructor.emit('unref', self); +}; +function processChange(doc, metadata, opts) { + var changeList = [{rev: doc._rev}]; + if (opts.style === 'all_docs') { + changeList = pouchdbMerge.collectLeaves(metadata.rev_tree) + .map(function (x) { return {rev: x.rev}; }); } + var change = { + id: metadata.id, + changes: changeList, + doc: doc + }; - self.once('destroyed', onDestroyed); - self.once('closed', onClosed); - self.constructor.emit('ref', self); -} - -inherits(PouchDB$2, AbstractPouchDB); -function PouchDB$2(name, opts) { - // In Node our test suite only tests this for PouchAlt unfortunately - /* istanbul ignore if */ - if (!(this instanceof PouchDB$2)) { - return new PouchDB$2(name, opts); + if (pouchdbMerge.isDeleted(metadata, doc._rev)) { + change.deleted = true; + } + if (opts.conflicts) { + change.doc._conflicts = pouchdbMerge.collectConflicts(metadata); + if (!change.doc._conflicts.length) { + delete change.doc._conflicts; + } } + return change; +} +Changes.prototype.validateChanges = function (opts) { + var callback = opts.complete; var self = this; - opts = opts || {}; - if (name && typeof name === 'object') { - opts = name; - name = opts.name; - delete opts.name; + /* istanbul ignore else */ + if (PouchDB._changesFilterPlugin) { + PouchDB._changesFilterPlugin.validate(opts, function (err) { + if (err) { + return callback(err); + } + self.doChanges(opts); + }); + } else { + self.doChanges(opts); } +}; - this.__opts = opts = pouchdbUtils.clone(opts); - - self.auto_compaction = opts.auto_compaction; - self.prefix = PouchDB$2.prefix; +Changes.prototype.doChanges = function (opts) { + var self = this; + var callback = opts.complete; - if (typeof name !== 'string') { - throw new Error('Missing/invalid DB name'); + opts = pouchdbUtils.clone(opts); + if ('live' in opts && !('continuous' in opts)) { + opts.continuous = opts.live; } + opts.processChange = processChange; - var prefixedName = (opts.prefix || '') + name; - var backend = parseAdapter(prefixedName, opts); + if (opts.since === 'latest') { + opts.since = 'now'; + } + if (!opts.since) { + opts.since = 0; + } + if (opts.since === 'now') { + this.db.info().then(function (info) { + /* istanbul ignore if */ + if (self.isCancelled) { + callback(null, {status: 'cancelled'}); + return; + } + opts.since = info.update_seq; + self.doChanges(opts); + }, callback); + return; + } - opts.name = backend.name; - opts.adapter = opts.adapter || backend.adapter; + /* istanbul ignore else */ + if (PouchDB._changesFilterPlugin) { + PouchDB._changesFilterPlugin.normalize(opts); + if (PouchDB._changesFilterPlugin.shouldFilter(this, opts)) { + return PouchDB._changesFilterPlugin.filter(this, opts); + } + } else { + ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) { + if (key in opts) { + pouchdbUtils.guardedConsole('warn', + 'The "' + key + '" option was passed in to changes/replicate, ' + + 'but pouchdb-changes-filter plugin is not installed, so it ' + + 'was ignored. Please install the plugin to enable filtering.' + ); + } + }); + } - self.name = name; - self._adapter = opts.adapter; - PouchDB$2.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]); + if (!('descending' in opts)) { + opts.descending = false; + } - if (!PouchDB$2.adapters[opts.adapter] || - !PouchDB$2.adapters[opts.adapter].valid()) { - throw new Error('Invalid Adapter: ' + opts.adapter); + // 0 and 1 should return 1 document + opts.limit = opts.limit === 0 ? 1 : opts.limit; + opts.complete = callback; + var newPromise = this.db._changes(opts); + /* istanbul ignore else */ + if (newPromise && typeof newPromise.cancel === 'function') { + var cancel = self.cancel; + self.cancel = getArguments(function (args) { + newPromise.cancel(); + cancel.apply(this, args); + }); } +}; - AbstractPouchDB.call(self); - self.taskqueue = new TaskQueue$1(); +/* + * A generic pouch adapter + */ - self.adapter = opts.adapter; +function compare(left, right) { + return left < right ? -1 : left > right ? 1 : 0; +} - PouchDB$2.adapters[opts.adapter].call(self, opts, function (err) { - if (err) { - return self.taskqueue.fail(err); +// Wrapper for functions that call the bulkdocs api with a single doc, +// if the first result is an error, return an error +function yankError(callback, docId) { + return function (err, results) { + if (err || (results[0] && results[0].error)) { + err = err || results[0]; + err.docId = docId; + callback(err); + } else { + callback(null, results.length ? results[0] : results); } - prepareForDestruction(self); - - self.emit('created', self); - PouchDB$2.emit('created', self.name); - self.taskqueue.ready(self); - }); - + }; } -PouchDB$2.adapters = {}; -PouchDB$2.preferredAdapters = []; - -PouchDB$2.prefix = '_pouch_'; - -var eventEmitter = new events.EventEmitter(); - -function setUpEventEmitter(Pouch) { - Object.keys(events.EventEmitter.prototype).forEach(function (key) { - if (typeof events.EventEmitter.prototype[key] === 'function') { - Pouch[key] = eventEmitter[key].bind(eventEmitter); +// clean docs given to us by the user +function cleanDocs(docs) { + for (var i = 0; i < docs.length; i++) { + var doc = docs[i]; + if (doc._deleted) { + delete doc._attachments; // ignore atts for deleted docs + } else if (doc._attachments) { + // filter out extraneous keys from _attachments + var atts = Object.keys(doc._attachments); + for (var j = 0; j < atts.length; j++) { + var att = atts[j]; + doc._attachments[att] = pouchdbUtils.pick(doc._attachments[att], + ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']); + } } - }); + } +} - // these are created in constructor.js, and allow us to notify each DB with - // the same name that it was destroyed, via the constructor object - var destructListeners = Pouch._destructionListeners = new pouchdbCollections.Map(); +// compare two docs, first by _id then by _rev +function compareByIdThenRev(a, b) { + var idCompare = compare(a._id, b._id); + if (idCompare !== 0) { + return idCompare; + } + var aStart = a._revisions ? a._revisions.start : 0; + var bStart = b._revisions ? b._revisions.start : 0; + return compare(aStart, bStart); +} - Pouch.on('ref', function onConstructorRef(db) { - if (!destructListeners.has(db.name)) { - destructListeners.set(db.name, []); +// for every node in a revision tree computes its distance from the closest +// leaf +function computeHeight(revs) { + var height = {}; + var edges = []; + pouchdbMerge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) { + var rev = pos + "-" + id; + if (isLeaf) { + height[rev] = 0; } - destructListeners.get(db.name).push(db); + if (prnt !== undefined) { + edges.push({from: prnt, to: rev}); + } + return rev; }); - Pouch.on('unref', function onConstructorUnref(db) { - if (!destructListeners.has(db.name)) { - return; - } - var dbList = destructListeners.get(db.name); - var pos = dbList.indexOf(db); - if (pos < 0) { - /* istanbul ignore next */ - return; - } - dbList.splice(pos, 1); - if (dbList.length > 1) { - /* istanbul ignore next */ - destructListeners.set(db.name, dbList); + edges.reverse(); + edges.forEach(function (edge) { + if (height[edge.from] === undefined) { + height[edge.from] = 1 + height[edge.to]; } else { - destructListeners.delete(db.name); + height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]); } }); + return height; +} - Pouch.on('destroyed', function onConstructorDestroyed(name) { - if (!destructListeners.has(name)) { - return; +function allDocsKeysParse(opts) { + var keys = ('limit' in opts) ? + opts.keys.slice(opts.skip, opts.limit + opts.skip) : + (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys; + opts.keys = keys; + opts.skip = 0; + delete opts.limit; + if (opts.descending) { + keys.reverse(); + opts.descending = false; + } +} + +// all compaction is done in a queue, to avoid attaching +// too many listeners at once +function doNextCompaction(self) { + var task = self._compactionQueue[0]; + var opts = task.opts; + var callback = task.callback; + self.get('_local/compaction').catch(function () { + return false; + }).then(function (doc) { + if (doc && doc.last_seq) { + opts.last_seq = doc.last_seq; } - var dbList = destructListeners.get(name); - destructListeners.delete(name); - dbList.forEach(function (db) { - db.emit('destroyed',true); + self._compact(opts, function (err, res) { + /* istanbul ignore if */ + if (err) { + callback(err); + } else { + callback(null, res); + } + pouchdbUtils.nextTick(function () { + self._compactionQueue.shift(); + if (self._compactionQueue.length) { + doNextCompaction(self); + } + }); }); }); } -setUpEventEmitter(PouchDB$2); - -PouchDB$2.adapter = function (id, obj, addToPreferredAdapters) { - /* istanbul ignore else */ - if (obj.valid()) { - PouchDB$2.adapters[id] = obj; - if (addToPreferredAdapters) { - PouchDB$2.preferredAdapters.push(id); - } +function attachmentNameError(name) { + if (name.charAt(0) === '_') { + return name + ' is not a valid attachment name, attachment ' + + 'names cannot start with \'_\''; } -}; + return false; +} -PouchDB$2.plugin = function (obj) { - if (typeof obj === 'function') { // function style for plugins - obj(PouchDB$2); - } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) { - throw new Error('Invalid plugin: got "' + obj + '", expected an object or a function'); - } else { - Object.keys(obj).forEach(function (id) { // object style for plugins - PouchDB$2.prototype[id] = obj[id]; - }); +inherits(AbstractPouchDB, events.EventEmitter); + +function AbstractPouchDB() { + events.EventEmitter.call(this); +} + +AbstractPouchDB.prototype.post = + pouchdbUtils.adapterFun('post', function (doc, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; } - if (this.__defaults) { - PouchDB$2.__defaults = pouchdbUtils.assign({}, this.__defaults); + if (typeof doc !== 'object' || Array.isArray(doc)) { + return callback(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); } - return PouchDB$2; -}; + this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id)); +}); -PouchDB$2.defaults = function (defaultOpts) { - function PouchAlt(name, opts) { - if (!(this instanceof PouchAlt)) { - return new PouchAlt(name, opts); +AbstractPouchDB.prototype.put = pouchdbUtils.adapterFun('put', function (doc, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (typeof doc !== 'object' || Array.isArray(doc)) { + return cb(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); + } + pouchdbUtils.invalidIdError(doc._id); + if (pouchdbMerge.isLocalId(doc._id) && typeof this._putLocal === 'function') { + if (doc._deleted) { + return this._removeLocal(doc, cb); + } else { + return this._putLocal(doc, cb); } + } + var self = this; + if (opts.force && doc._rev) { + transformForceOptionToNewEditsOption(); + putDoc(function (err) { + var result = err ? null : {ok: true, id: doc._id, rev: doc._rev}; + cb(err, result); + }); + } else { + putDoc(cb); + } - opts = opts || {}; + function transformForceOptionToNewEditsOption() { + var parts = doc._rev.split('-'); + var oldRevId = parts[1]; + var oldRevNum = parseInt(parts[0], 10); - if (name && typeof name === 'object') { - opts = name; - name = opts.name; - delete opts.name; + var newRevNum = oldRevNum + 1; + var newRevId = pouchdbUtils.rev(); + + doc._revisions = { + start: newRevNum, + ids: [newRevId, oldRevId] + }; + doc._rev = newRevNum + '-' + newRevId; + opts.new_edits = false; + } + function putDoc(next) { + if (typeof self._put === 'function' && opts.new_edits !== false) { + self._put(doc, opts, next); + } else { + self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id)); } + } +}); - opts = pouchdbUtils.assign({}, PouchAlt.__defaults, opts); - PouchDB$2.call(this, name, opts); +AbstractPouchDB.prototype.putAttachment = + pouchdbUtils.adapterFun('putAttachment', function (docId, attachmentId, rev, + blob, type) { + var api = this; + if (typeof type === 'function') { + type = blob; + blob = rev; + rev = null; + } + // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267 + /* istanbul ignore if */ + if (typeof type === 'undefined') { + type = blob; + blob = rev; + rev = null; + } + if (!type) { + pouchdbUtils.guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type'); } - inherits(PouchAlt, PouchDB$2); + function createAttachment(doc) { + var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0; + doc._attachments = doc._attachments || {}; + doc._attachments[attachmentId] = { + content_type: type, + data: blob, + revpos: ++prevrevpos + }; + return api.put(doc); + } - PouchAlt.preferredAdapters = PouchDB$2.preferredAdapters.slice(); - Object.keys(PouchDB$2).forEach(function (key) { - if (!(key in PouchAlt)) { - PouchAlt[key] = PouchDB$2[key]; + return api.get(docId).then(function (doc) { + if (doc._rev !== rev) { + throw pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT); } - }); - // make default options transitive - // https://github.com/pouchdb/pouchdb/issues/5922 - PouchAlt.__defaults = pouchdbUtils.assign({}, this.__defaults, defaultOpts); + return createAttachment(doc); + }, function (err) { + // create new doc + /* istanbul ignore else */ + if (err.reason === pouchdbErrors.MISSING_DOC.message) { + return createAttachment({_id: docId}); + } else { + throw err; + } + }); +}); - return PouchAlt; -}; +AbstractPouchDB.prototype.removeAttachment = + pouchdbUtils.adapterFun('removeAttachment', function (docId, attachmentId, rev, + callback) { + var self = this; + self.get(docId, function (err, obj) { + /* istanbul ignore if */ + if (err) { + callback(err); + return; + } + if (obj._rev !== rev) { + callback(pouchdbErrors.createError(pouchdbErrors.REV_CONFLICT)); + return; + } + /* istanbul ignore if */ + if (!obj._attachments) { + return callback(); + } + delete obj._attachments[attachmentId]; + if (Object.keys(obj._attachments).length === 0) { + delete obj._attachments; + } + self.put(obj, callback); + }); +}); -// managed automatically by set-version.js -var version = "6.4.1"; +AbstractPouchDB.prototype.remove = + pouchdbUtils.adapterFun('remove', function (docOrId, optsOrRev, opts, callback) { + var doc; + if (typeof optsOrRev === 'string') { + // id, rev, opts, callback style + doc = { + _id: docOrId, + _rev: optsOrRev + }; + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + } else { + // doc, opts, callback style + doc = docOrId; + if (typeof optsOrRev === 'function') { + callback = optsOrRev; + opts = {}; + } else { + callback = opts; + opts = optsOrRev; + } + } + opts = opts || {}; + opts.was_delete = true; + var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)}; + newDoc._deleted = true; + if (pouchdbMerge.isLocalId(newDoc._id) && typeof this._removeLocal === 'function') { + return this._removeLocal(doc, callback); + } + this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id)); +}); -// TODO: remove from pouchdb-core (breaking) -PouchDB$2.plugin(pouchDebug); +AbstractPouchDB.prototype.revsDiff = + pouchdbUtils.adapterFun('revsDiff', function (req, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + var ids = Object.keys(req); -// TODO: remove from pouchdb-core (breaking) -PouchDB$2.plugin(pouchChangesFilter); + if (!ids.length) { + return callback(null, {}); + } -PouchDB$2.version = version; + var count = 0; + var missing = new pouchdbCollections.Map(); -module.exports = PouchDB$2; + function addToMissing(id, revId) { + if (!missing.has(id)) { + missing.set(id, {missing: []}); + } + missing.get(id).missing.push(revId); + } -},{"argsarray":39,"events":491,"inherits":495,"pouchdb-changes-filter":518,"pouchdb-collections":523,"pouchdb-debug":525,"pouchdb-errors":529,"pouchdb-merge":538,"pouchdb-promise":524,"pouchdb-utils":542}],523:[function(require,module,exports){ -arguments[4][505][0].apply(exports,arguments) -},{"dup":505}],524:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],525:[function(require,module,exports){ -'use strict'; + function processDoc(id, rev_tree) { + // Is this fast enough? Maybe we should switch to a set simulated by a map + var missingForId = req[id].slice(0); + pouchdbMerge.traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx, + opts) { + var rev = pos + '-' + revHash; + var idx = missingForId.indexOf(rev); + if (idx === -1) { + return; + } -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + missingForId.splice(idx, 1); + /* istanbul ignore if */ + if (opts.status !== 'available') { + addToMissing(id, rev); + } + }); -var debug = _interopDefault(require('debug')); + // Traversing the tree is synchronous, so now `missingForId` contains + // revisions that were not found in the tree + missingForId.forEach(function (rev) { + addToMissing(id, rev); + }); + } -function debugPouch(PouchDB) { - PouchDB.debug = debug; - var logs = {}; - /* istanbul ignore next */ - PouchDB.on('debug', function (args) { - // first argument is log identifier - var logId = args[0]; - // rest should be passed verbatim to debug module - var logArgs = args.slice(1); - if (!logs[logId]) { - logs[logId] = debug('pouchdb:' + logId); - } - logs[logId].apply(null, logArgs); - }); -} + ids.map(function (id) { + this._getRevisionTree(id, function (err, rev_tree) { + if (err && err.status === 404 && err.message === 'missing') { + missing.set(id, {missing: req[id]}); + } else if (err) { + /* istanbul ignore next */ + return callback(err); + } else { + processDoc(id, rev_tree); + } -module.exports = debugPouch; + if (++count === ids.length) { + // convert LazyMap to object + var missingObj = {}; + missing.forEach(function (value, key) { + missingObj[key] = value; + }); + return callback(null, missingObj); + } + }); + }, this); +}); -},{"debug":526}],526:[function(require,module,exports){ -(function (process){ -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ +// _bulk_get API for faster replication, as described in +// https://github.com/apache/couchdb-chttpd/pull/33 +// At the "abstract" level, it will just run multiple get()s in +// parallel, because this isn't much of a performance cost +// for local databases (except the cost of multiple transactions, which is +// small). The http adapter overrides this in order +// to do a more efficient single HTTP request. +AbstractPouchDB.prototype.bulkGet = + pouchdbUtils.adapterFun('bulkGet', function (opts, callback) { + pouchdbUtils.bulkGetShim(this, opts, callback); +}); -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); +// compact one document and fire callback +// by compacting we mean removing all revisions which +// are further from the leaf in revision tree than max_height +AbstractPouchDB.prototype.compactDocument = + pouchdbUtils.adapterFun('compactDocument', function (docId, maxHeight, callback) { + var self = this; + this._getRevisionTree(docId, function (err, revTree) { + /* istanbul ignore if */ + if (err) { + return callback(err); + } + var height = computeHeight(revTree); + var candidates = []; + var revs = []; + Object.keys(height).forEach(function (rev) { + if (height[rev] > maxHeight) { + candidates.push(rev); + } + }); -/** - * Colors. - */ + pouchdbMerge.traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) { + var rev = pos + '-' + revHash; + if (opts.status === 'available' && candidates.indexOf(rev) !== -1) { + revs.push(rev); + } + }); + self._doCompaction(docId, revs, callback); + }); +}); -exports.colors = [ - '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', - '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', - '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', - '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', - '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', - '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', - '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', - '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', - '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', - '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', - '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' -]; +// compact the whole database using single document +// compaction +AbstractPouchDB.prototype.compact = + pouchdbUtils.adapterFun('compact', function (opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ + var self = this; + opts = opts || {}; -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { - return true; + self._compactionQueue = self._compactionQueue || []; + self._compactionQueue.push({opts: opts, callback: callback}); + if (self._compactionQueue.length === 1) { + doNextCompaction(self); } +}); +AbstractPouchDB.prototype._compact = function (opts, callback) { + var self = this; + var changesOpts = { + return_docs: false, + last_seq: opts.last_seq || 0 + }; + var promises = []; - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; + function onChange(row) { + promises.push(self.compactDocument(row.id, 0)); } - - // is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (err) { - return '[UnexpectedJSONParseError]: ' + err.message; + function onComplete(resp) { + var lastSeq = resp.last_seq; + Promise.all(promises).then(function () { + return pouchdbUtils.upsert(self, '_local/compaction', function deltaFunc(doc) { + if (!doc.last_seq || doc.last_seq < lastSeq) { + doc.last_seq = lastSeq; + return doc; + } + return false; // somebody else got here first, don't update + }); + }).then(function () { + callback(null, {ok: true}); + }).catch(callback); } + self.changes(changesOpts) + .on('change', onChange) + .on('complete', onComplete) + .on('error', callback); }; +/* Begin api wrappers. Specific functionality to storage belongs in the + _[method] */ +AbstractPouchDB.prototype.get = pouchdbUtils.adapterFun('get', function (id, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (typeof id !== 'string') { + return cb(pouchdbErrors.createError(pouchdbErrors.INVALID_ID)); + } + if (pouchdbMerge.isLocalId(id) && typeof this._getLocal === 'function') { + return this._getLocal(id, cb); + } + var leaves = [], self = this; -/** - * Colorize log arguments if enabled. - * - * @api public - */ + function finishOpenRevs() { + var result = []; + var count = leaves.length; + /* istanbul ignore if */ + if (!count) { + return cb(null, result); + } -function formatArgs(args) { - var useColors = this.useColors; + // order with open_revs is unspecified + leaves.forEach(function (leaf) { + self.get(id, { + rev: leaf, + revs: opts.revs, + latest: opts.latest, + attachments: opts.attachments, + binary: opts.binary + }, function (err, doc) { + if (!err) { + // using latest=true can produce duplicates + var existing; + for (var i = 0, l = result.length; i < l; i++) { + if (result[i].ok && result[i].ok._rev === doc._rev) { + existing = true; + break; + } + } + if (!existing) { + result.push({ok: doc}); + } + } else { + result.push({missing: leaf}); + } + count--; + if (!count) { + cb(null, result); + } + }); + }); + } - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); + if (opts.open_revs) { + if (opts.open_revs === "all") { + this._getRevisionTree(id, function (err, rev_tree) { + if (err) { + return cb(err); + } + leaves = pouchdbMerge.collectLeaves(rev_tree).map(function (leaf) { + return leaf.rev; + }); + finishOpenRevs(); + }); + } else { + if (Array.isArray(opts.open_revs)) { + leaves = opts.open_revs; + for (var i = 0; i < leaves.length; i++) { + var l = leaves[i]; + // looks like it's the only thing couchdb checks + if (!(typeof (l) === "string" && /^\d+-/.test(l))) { + return cb(pouchdbErrors.createError(pouchdbErrors.INVALID_REV)); + } + } + finishOpenRevs(); + } else { + return cb(pouchdbErrors.createError(pouchdbErrors.UNKNOWN_ERROR, 'function_clause')); + } + } + return; // open_revs does not like other options + } - if (!useColors) return; + return this._get(id, opts, function (err, result) { + if (err) { + err.docId = id; + return cb(err); + } - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit') + var doc = result.doc; + var metadata = result.metadata; + var ctx = result.ctx; - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; + if (opts.conflicts) { + var conflicts = pouchdbMerge.collectConflicts(metadata); + if (conflicts.length) { + doc._conflicts = conflicts; + } } - }); - args.splice(lastC, 0, c); -} + if (pouchdbMerge.isDeleted(metadata, doc._rev)) { + doc._deleted = true; + } -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ + if (opts.revs || opts.revs_info) { + var splittedRev = doc._rev.split('-'); + var revNo = parseInt(splittedRev[0], 10); + var revHash = splittedRev[1]; -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ + var paths = pouchdbMerge.rootToLeaf(metadata.rev_tree); + var path = null; -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} + for (var i = 0; i < paths.length; i++) { + var currentPath = paths[i]; + var hashIndex = currentPath.ids.map(function (x) { return x.id; }) + .indexOf(revHash); + var hashFoundAtRevPos = hashIndex === (revNo - 1); -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ + if (hashFoundAtRevPos || (!path && hashIndex !== -1)) { + path = currentPath; + } + } -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} + var indexOfRev = path.ids.map(function (x) { return x.id; }) + .indexOf(doc._rev.split('-')[1]) + 1; + var howMany = path.ids.length - indexOfRev; + path.ids.splice(indexOfRev, howMany); + path.ids.reverse(); - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } + if (opts.revs) { + doc._revisions = { + start: (path.pos + path.ids.length) - 1, + ids: path.ids.map(function (rev) { + return rev.id; + }) + }; + } + if (opts.revs_info) { + var pos = path.pos + path.ids.length; + doc._revs_info = path.ids.map(function (rev) { + pos--; + return { + rev: pos + '-' + rev.id, + status: rev.opts.status + }; + }); + } + } - return r; -} + if (opts.attachments && doc._attachments) { + var attachments = doc._attachments; + var count = Object.keys(attachments).length; + if (count === 0) { + return cb(null, doc); + } + Object.keys(attachments).forEach(function (key) { + this._getAttachment(doc._id, key, attachments[key], { + // Previously the revision handling was done in adapter.js + // getAttachment, however since idb-next doesnt we need to + // pass the rev through + rev: doc._rev, + binary: opts.binary, + ctx: ctx + }, function (err, data) { + var att = doc._attachments[key]; + att.data = data; + delete att.stub; + delete att.length; + if (!--count) { + cb(null, doc); + } + }); + }, self); + } else { + if (doc._attachments) { + for (var key in doc._attachments) { + /* istanbul ignore else */ + if (doc._attachments.hasOwnProperty(key)) { + doc._attachments[key].stub = true; + } + } + } + cb(null, doc); + } + }); +}); -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ +// TODO: I dont like this, it forces an extra read for every +// attachment read and enforces a confusing api between +// adapter.js and the adapter implementation +AbstractPouchDB.prototype.getAttachment = + pouchdbUtils.adapterFun('getAttachment', function (docId, attachmentId, opts, callback) { + var self = this; + if (opts instanceof Function) { + callback = opts; + opts = {}; + } + this._get(docId, opts, function (err, res) { + if (err) { + return callback(err); + } + if (res.doc._attachments && res.doc._attachments[attachmentId]) { + opts.ctx = res.ctx; + opts.binary = true; + self._getAttachment(docId, attachmentId, + res.doc._attachments[attachmentId], opts, callback); + } else { + return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC)); + } + }); +}); -exports.enable(load()); +AbstractPouchDB.prototype.allDocs = + pouchdbUtils.adapterFun('allDocs', function (opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0; + if (opts.start_key) { + opts.startkey = opts.start_key; + } + if (opts.end_key) { + opts.endkey = opts.end_key; + } + if ('keys' in opts) { + if (!Array.isArray(opts.keys)) { + return callback(new TypeError('options.keys must be an array')); + } + var incompatibleOpt = + ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) { + return incompatibleOpt in opts; + })[0]; + if (incompatibleOpt) { + callback(pouchdbErrors.createError(pouchdbErrors.QUERY_PARSE_ERROR, + 'Query parameter `' + incompatibleOpt + + '` is not compatible with multi-get' + )); + return; + } + if (!pouchdbUtils.isRemote(this)) { + allDocsKeysParse(opts); + if (opts.keys.length === 0) { + return this._allDocs({limit: 0}, callback); + } + } + } -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ + return this._allDocs(opts, callback); +}); -function localstorage() { - try { - return window.localStorage; - } catch (e) {} -} +AbstractPouchDB.prototype.changes = function (opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return new Changes(this, opts, callback); +}; -}).call(this,require('_process')) -},{"./debug":527,"_process":546}],527:[function(require,module,exports){ +AbstractPouchDB.prototype.close = pouchdbUtils.adapterFun('close', function (callback) { + this._closed = true; + this.emit('closed'); + return this._close(callback); +}); -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ +AbstractPouchDB.prototype.info = pouchdbUtils.adapterFun('info', function (callback) { + var self = this; + this._info(function (err, info) { + if (err) { + return callback(err); + } + // assume we know better than the adapter, unless it informs us + info.db_name = info.db_name || self.name; + info.auto_compaction = !!(self.auto_compaction && !pouchdbUtils.isRemote(self)); + info.adapter = self.adapter; + callback(null, info); + }); +}); -exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); +AbstractPouchDB.prototype.id = pouchdbUtils.adapterFun('id', function (callback) { + return this._id(callback); +}); -/** - * Active `debug` instances. - */ -exports.instances = []; +/* istanbul ignore next */ +AbstractPouchDB.prototype.type = function () { + return (typeof this._type === 'function') ? this._type() : this.adapter; +}; -/** - * The currently active debug mode names, and names to skip. - */ +AbstractPouchDB.prototype.bulkDocs = + pouchdbUtils.adapterFun('bulkDocs', function (req, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } -exports.names = []; -exports.skips = []; + opts = opts || {}; -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ + if (Array.isArray(req)) { + req = { + docs: req + }; + } -exports.formatters = {}; + if (!req || !req.docs || !Array.isArray(req.docs)) { + return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_BULK_DOCS)); + } -/** - * Select a color. - * @param {String} namespace - * @return {Number} - * @api private - */ + for (var i = 0; i < req.docs.length; ++i) { + if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) { + return callback(pouchdbErrors.createError(pouchdbErrors.NOT_AN_OBJECT)); + } + } -function selectColor(namespace) { - var hash = 0, i; + var attachmentError; + req.docs.forEach(function (doc) { + if (doc._attachments) { + Object.keys(doc._attachments).forEach(function (name) { + attachmentError = attachmentError || attachmentNameError(name); + if (!doc._attachments[name].content_type) { + pouchdbUtils.guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type'); + } + }); + } + }); - for (i in namespace) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer + if (attachmentError) { + return callback(pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, attachmentError)); } - return exports.colors[Math.abs(hash) % exports.colors.length]; -} + if (!('new_edits' in opts)) { + if ('new_edits' in req) { + opts.new_edits = req.new_edits; + } else { + opts.new_edits = true; + } + } -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ + var adapter = this; + if (!opts.new_edits && !pouchdbUtils.isRemote(adapter)) { + // ensure revisions of the same doc are sorted, so that + // the local adapter processes them correctly (#2935) + req.docs.sort(compareByIdThenRev); + } -function createDebug(namespace) { + cleanDocs(req.docs); - var prevTime; + // in the case of conflicts, we want to return the _ids to the user + // however, the underlying adapter may destroy the docs array, so + // create a copy here + var ids = req.docs.map(function (doc) { + return doc._id; + }); - function debug() { - // disabled? - if (!debug.enabled) return; + return this._bulkDocs(req, opts, function (err, res) { + if (err) { + return callback(err); + } + if (!opts.new_edits) { + // this is what couch does when new_edits is false + res = res.filter(function (x) { + return x.error; + }); + } + // add ids for error/conflict responses (not required for CouchDB) + if (!pouchdbUtils.isRemote(adapter)) { + for (var i = 0, l = res.length; i < l; i++) { + res[i].id = res[i].id || ids[i]; + } + } - var self = debug; + callback(null, res); + }); +}); - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; +AbstractPouchDB.prototype.registerDependentDatabase = + pouchdbUtils.adapterFun('registerDependentDatabase', function (dependentDb, + callback) { + var depDB = new this.constructor(dependentDb, this.__opts); - // turn the `arguments` into a proper Array - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; + function diffFun(doc) { + doc.dependentDbs = doc.dependentDbs || {}; + if (doc.dependentDbs[dependentDb]) { + return false; // no update required } + doc.dependentDbs[dependentDb] = true; + return doc; + } + pouchdbUtils.upsert(this, '_local/_pouch_dependentDbs', diffFun) + .then(function () { + callback(null, {db: depDB}); + }).catch(callback); +}); - args[0] = exports.coerce(args[0]); +AbstractPouchDB.prototype.destroy = + pouchdbUtils.adapterFun('destroy', function (opts, callback) { - if ('string' !== typeof args[0]) { - // anything else let's inspect with %O - args.unshift('%O'); - } + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); + var self = this; + var usePrefix = 'use_prefix' in self ? self.use_prefix : true; - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; + function destroyDb() { + // call destroy method of the particular adaptor + self._destroy(opts, function (err, resp) { + if (err) { + return callback(err); } - return match; + self._destroyed = true; + self.emit('destroyed'); + callback(null, resp || { 'ok': true }); }); - - // apply env-specific formatting (colors, etc.) - exports.formatArgs.call(self, args); - - var logFn = debug.log || exports.log || console.log.bind(console); - logFn.apply(self, args); } - debug.namespace = namespace; - debug.enabled = exports.enabled(namespace); - debug.useColors = exports.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - - // env-specific initialization logic for debug instances - if ('function' === typeof exports.init) { - exports.init(debug); + if (pouchdbUtils.isRemote(self)) { + // no need to check for dependent DBs if it's a remote DB + return destroyDb(); } - exports.instances.push(debug); + self.get('_local/_pouch_dependentDbs', function (err, localDoc) { + if (err) { + /* istanbul ignore if */ + if (err.status !== 404) { + return callback(err); + } else { // no dependencies + return destroyDb(); + } + } + var dependentDbs = localDoc.dependentDbs; + var PouchDB = self.constructor; + var deletedMap = Object.keys(dependentDbs).map(function (name) { + // use_prefix is only false in the browser + /* istanbul ignore next */ + var trueName = usePrefix ? + name.replace(new RegExp('^' + PouchDB.prefix), '') : name; + return new PouchDB(trueName, self.__opts).destroy(); + }); + Promise.all(deletedMap).then(destroyDb, callback); + }); +}); - return debug; +function TaskQueue$1() { + this.isReady = false; + this.failed = false; + this.queue = []; } -function destroy () { - var index = exports.instances.indexOf(this); - if (index !== -1) { - exports.instances.splice(index, 1); - return true; +TaskQueue$1.prototype.execute = function () { + var fun; + if (this.failed) { + while ((fun = this.queue.shift())) { + fun(this.failed); + } } else { - return false; + while ((fun = this.queue.shift())) { + fun(); + } } -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - exports.names = []; - exports.skips = []; +}; - var i; - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; +TaskQueue$1.prototype.fail = function (err) { + this.failed = err; + this.execute(); +}; - for (i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } +TaskQueue$1.prototype.ready = function (db) { + this.isReady = true; + this.db = db; + this.execute(); +}; - for (i = 0; i < exports.instances.length; i++) { - var instance = exports.instances[i]; - instance.enabled = exports.enabled(instance.namespace); +TaskQueue$1.prototype.addTask = function (fun) { + this.queue.push(fun); + if (this.failed) { + this.execute(); } -} +}; -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} +function parseAdapter(name, opts) { + var match = name.match(/([a-z-]*):\/\/(.*)/); + if (match) { + // the http adapter expects the fully qualified name + return { + name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2], + adapter: match[1] + }; + } -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ + var adapters = PouchDB.adapters; + var preferredAdapters = PouchDB.preferredAdapters; + var prefix = PouchDB.prefix; + var adapterName = opts.adapter; -function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; + if (!adapterName) { // automatically determine adapter + for (var i = 0; i < preferredAdapters.length; ++i) { + adapterName = preferredAdapters[i]; + // check for browsers that have been upgraded from websql-only to websql+idb + /* istanbul ignore if */ + if (adapterName === 'idb' && 'websql' in adapters && + pouchdbUtils.hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) { + // log it, because this can be confusing during development + pouchdbUtils.guardedConsole('log', 'PouchDB is downgrading "' + name + '" to WebSQL to' + + ' avoid data loss, because it was already opened with WebSQL.'); + continue; // keep using websql to avoid user data loss + } + break; } } - return false; -} -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ + var adapter = adapters[adapterName]; -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} + // if adapter is invalid, then an error will be thrown later + var usePrefix = (adapter && 'use_prefix' in adapter) ? + adapter.use_prefix : true; -},{"ms":528}],528:[function(require,module,exports){ -/** - * Helpers. - */ + return { + name: usePrefix ? (prefix + name) : name, + adapter: adapterName + }; +} -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; +// OK, so here's the deal. Consider this code: +// var db1 = new PouchDB('foo'); +// var db2 = new PouchDB('foo'); +// db1.destroy(); +// ^ these two both need to emit 'destroyed' events, +// as well as the PouchDB constructor itself. +// So we have one db object (whichever one got destroy() called on it) +// responsible for emitting the initial event, which then gets emitted +// by the constructor, which then broadcasts it to any other dbs +// that may have been created with the same name. +function prepareForDestruction(self) { -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ + function onDestroyed(from_constructor) { + self.removeListener('closed', onClosed); + if (!from_constructor) { + self.constructor.emit('destroyed', self.name); + } + } -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); + function onClosed() { + self.removeListener('destroyed', onDestroyed); + self.constructor.emit('unref', self); } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ + self.once('destroyed', onDestroyed); + self.once('closed', onClosed); + self.constructor.emit('ref', self); +} -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; +inherits(PouchDB, AbstractPouchDB); +function PouchDB(name, opts) { + // In Node our test suite only tests this for PouchAlt unfortunately + /* istanbul ignore if */ + if (!(this instanceof PouchDB)) { + return new PouchDB(name, opts); } -} -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ + var self = this; + opts = opts || {}; -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd'; - } - if (ms >= h) { - return Math.round(ms / h) + 'h'; - } - if (ms >= m) { - return Math.round(ms / m) + 'm'; + if (name && typeof name === 'object') { + opts = name; + name = opts.name; + delete opts.name; } - if (ms >= s) { - return Math.round(ms / s) + 's'; + + this.__opts = opts = pouchdbUtils.clone(opts); + + self.auto_compaction = opts.auto_compaction; + self.prefix = PouchDB.prefix; + + if (typeof name !== 'string') { + throw new Error('Missing/invalid DB name'); } - return ms + 'ms'; -} -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ + var prefixedName = (opts.prefix || '') + name; + var backend = parseAdapter(prefixedName, opts); -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms'; -} + opts.name = backend.name; + opts.adapter = opts.adapter || backend.adapter; -/** - * Pluralization helper. - */ + self.name = name; + self._adapter = opts.adapter; + PouchDB.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]); -function plural(ms, n, name) { - if (ms < n) { - return; - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name; + if (!PouchDB.adapters[opts.adapter] || + !PouchDB.adapters[opts.adapter].valid()) { + throw new Error('Invalid Adapter: ' + opts.adapter); } - return Math.ceil(ms / n) + ' ' + name + 's'; -} -},{}],529:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); + AbstractPouchDB.call(self); + self.taskqueue = new TaskQueue$1(); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + self.adapter = opts.adapter; -var inherits = _interopDefault(require('inherits')); + PouchDB.adapters[opts.adapter].call(self, opts, function (err) { + if (err) { + return self.taskqueue.fail(err); + } + prepareForDestruction(self); -inherits(PouchError, Error); + self.emit('created', self); + PouchDB.emit('created', self.name); + self.taskqueue.ready(self); + }); -function PouchError(status, error, reason) { - Error.call(this, reason); - this.status = status; - this.name = error; - this.message = reason; - this.error = true; } -PouchError.prototype.toString = function () { - return JSON.stringify({ - status: this.status, - name: this.name, - message: this.message, - reason: this.reason - }); -}; +PouchDB.adapters = {}; +PouchDB.preferredAdapters = []; -var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); -var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); -var MISSING_DOC = new PouchError(404, 'not_found', 'missing'); -var REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict'); -var INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string'); -var MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts'); -var RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.'); -var NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open'); -var UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error'); -var BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid'); -var INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid'); -var QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid'); -var DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member'); -var BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request'); -var NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object'); -var DB_MISSING = new PouchError(404, 'not_found', 'Database not found'); -var IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown'); -var WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown'); -var LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown'); -var FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function'); -var INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format'); -var FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.'); -var MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\'t found'); -var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid'); +PouchDB.prefix = '_pouch_'; -function createError(error, reason) { - function CustomPouchError(reason) { - // inherit error properties from our parent error manually - // so as to allow proper JSON parsing. - /* jshint ignore:start */ - for (var p in error) { - if (typeof error[p] !== 'function') { - this[p] = error[p]; - } +var eventEmitter = new events.EventEmitter(); + +function setUpEventEmitter(Pouch) { + Object.keys(events.EventEmitter.prototype).forEach(function (key) { + if (typeof events.EventEmitter.prototype[key] === 'function') { + Pouch[key] = eventEmitter[key].bind(eventEmitter); } - /* jshint ignore:end */ - if (reason !== undefined) { - this.reason = reason; + }); + + // these are created in constructor.js, and allow us to notify each DB with + // the same name that it was destroyed, via the constructor object + var destructListeners = Pouch._destructionListeners = new pouchdbCollections.Map(); + + Pouch.on('ref', function onConstructorRef(db) { + if (!destructListeners.has(db.name)) { + destructListeners.set(db.name, []); } - } - CustomPouchError.prototype = PouchError.prototype; - return new CustomPouchError(reason); -} + destructListeners.get(db.name).push(db); + }); -function generateErrorFromResponse(err) { + Pouch.on('unref', function onConstructorUnref(db) { + if (!destructListeners.has(db.name)) { + return; + } + var dbList = destructListeners.get(db.name); + var pos = dbList.indexOf(db); + if (pos < 0) { + /* istanbul ignore next */ + return; + } + dbList.splice(pos, 1); + if (dbList.length > 1) { + /* istanbul ignore next */ + destructListeners.set(db.name, dbList); + } else { + destructListeners.delete(db.name); + } + }); - if (typeof err !== 'object') { - var data = err; - err = UNKNOWN_ERROR; - err.data = data; - } + Pouch.on('destroyed', function onConstructorDestroyed(name) { + if (!destructListeners.has(name)) { + return; + } + var dbList = destructListeners.get(name); + destructListeners.delete(name); + dbList.forEach(function (db) { + db.emit('destroyed',true); + }); + }); +} - if ('error' in err && err.error === 'conflict') { - err.name = 'conflict'; - err.status = 409; - } +setUpEventEmitter(PouchDB); - if (!('name' in err)) { - err.name = err.error || 'unknown'; +PouchDB.adapter = function (id, obj, addToPreferredAdapters) { + /* istanbul ignore else */ + if (obj.valid()) { + PouchDB.adapters[id] = obj; + if (addToPreferredAdapters) { + PouchDB.preferredAdapters.push(id); + } } +}; - if (!('status' in err)) { - err.status = 500; +PouchDB.plugin = function (obj) { + if (typeof obj === 'function') { // function style for plugins + obj(PouchDB); + } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) { + throw new Error('Invalid plugin: got "' + obj + '", expected an object or a function'); + } else { + Object.keys(obj).forEach(function (id) { // object style for plugins + PouchDB.prototype[id] = obj[id]; + }); } - - if (!('message' in err)) { - err.message = err.message || err.reason; + if (this.__defaults) { + PouchDB.__defaults = pouchdbUtils.assign({}, this.__defaults); } + return PouchDB; +}; - return err; -} - -exports.UNAUTHORIZED = UNAUTHORIZED; -exports.MISSING_BULK_DOCS = MISSING_BULK_DOCS; -exports.MISSING_DOC = MISSING_DOC; -exports.REV_CONFLICT = REV_CONFLICT; -exports.INVALID_ID = INVALID_ID; -exports.MISSING_ID = MISSING_ID; -exports.RESERVED_ID = RESERVED_ID; -exports.NOT_OPEN = NOT_OPEN; -exports.UNKNOWN_ERROR = UNKNOWN_ERROR; -exports.BAD_ARG = BAD_ARG; -exports.INVALID_REQUEST = INVALID_REQUEST; -exports.QUERY_PARSE_ERROR = QUERY_PARSE_ERROR; -exports.DOC_VALIDATION = DOC_VALIDATION; -exports.BAD_REQUEST = BAD_REQUEST; -exports.NOT_AN_OBJECT = NOT_AN_OBJECT; -exports.DB_MISSING = DB_MISSING; -exports.WSQ_ERROR = WSQ_ERROR; -exports.LDB_ERROR = LDB_ERROR; -exports.FORBIDDEN = FORBIDDEN; -exports.INVALID_REV = INVALID_REV; -exports.FILE_EXISTS = FILE_EXISTS; -exports.MISSING_STUB = MISSING_STUB; -exports.IDB_ERROR = IDB_ERROR; -exports.INVALID_URL = INVALID_URL; -exports.createError = createError; -exports.generateErrorFromResponse = generateErrorFromResponse; - -},{"inherits":495}],530:[function(require,module,exports){ -(function (process){ -'use strict'; - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } +PouchDB.defaults = function (defaultOpts) { + function PouchAlt(name, opts) { + if (!(this instanceof PouchAlt)) { + return new PouchAlt(name, opts); + } -var pouchdbUtils = require('pouchdb-utils'); -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbSelectorCore = require('pouchdb-selector-core'); -var abstractMapReduce = _interopDefault(require('pouchdb-abstract-mapreduce')); -var pouchdbCollate = require('pouchdb-collate'); -var pouchdbMd5 = require('pouchdb-md5'); + opts = opts || {}; -// we restucture the supplied JSON considerably, because the official -// Mango API is very particular about a lot of this stuff, but we like -// to be liberal with what we accept in order to prevent mental -// breakdowns in our users -function massageCreateIndexRequest(requestDef) { - requestDef = pouchdbUtils.clone(requestDef); + if (name && typeof name === 'object') { + opts = name; + name = opts.name; + delete opts.name; + } - if (!requestDef.index) { - requestDef.index = {}; + opts = pouchdbUtils.assign({}, PouchAlt.__defaults, opts); + PouchDB.call(this, name, opts); } - ['type', 'name', 'ddoc'].forEach(function (key) { - if (requestDef.index[key]) { - requestDef[key] = requestDef.index[key]; - delete requestDef.index[key]; + inherits(PouchAlt, PouchDB); + + PouchAlt.preferredAdapters = PouchDB.preferredAdapters.slice(); + Object.keys(PouchDB).forEach(function (key) { + if (!(key in PouchAlt)) { + PouchAlt[key] = PouchDB[key]; } }); - if (requestDef.fields) { - requestDef.index.fields = requestDef.fields; - delete requestDef.fields; - } + // make default options transitive + // https://github.com/pouchdb/pouchdb/issues/5922 + PouchAlt.__defaults = pouchdbUtils.assign({}, this.__defaults, defaultOpts); - if (!requestDef.type) { - requestDef.type = 'json'; - } - return requestDef; -} + return PouchAlt; +}; -function createIndex(db, requestDef, callback) { - requestDef = massageCreateIndexRequest(requestDef); +// managed automatically by set-version.js +var version = "6.4.2"; - db.request({ - method: 'POST', - url: '_index', - body: requestDef - }, callback); -} +// TODO: remove from pouchdb-core (breaking) +PouchDB.plugin(pouchDebug); -function find(db, requestDef, callback) { - db.request({ - method: 'POST', - url: '_find', - body: requestDef - }, callback); -} +// TODO: remove from pouchdb-core (breaking) +PouchDB.plugin(pouchChangesFilter); -function explain(db, requestDef, callback) { - db.request({ - method: 'POST', - url: '_explain', - body: requestDef - }, callback); -} +PouchDB.version = version; -function getIndexes(db, callback) { - db.request({ - method: 'GET', - url: '_index' - }, callback); -} - -function deleteIndex(db, indexDef, callback) { +module.exports = PouchDB; +},{"argsarray":39,"events":491,"inherits":495,"pouchdb-changes-filter":538,"pouchdb-collections":539,"pouchdb-debug":540,"pouchdb-errors":541,"pouchdb-merge":542,"pouchdb-promise":543,"pouchdb-utils":544}],534:[function(require,module,exports){ +(function (process){ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ - var ddoc = indexDef.ddoc; - var type = indexDef.type || 'json'; - var name = indexDef.name; +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); - if (!ddoc) { - return callback(new Error('you must provide an index\'s ddoc')); - } +/** + * Colors. + */ - if (!name) { - return callback(new Error('you must provide an index\'s name')); - } +exports.colors = [ + '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', + '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', + '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', + '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', + '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', + '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', + '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', + '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', + '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', + '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', + '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' +]; - var url = '_index/' + [ddoc, type, name].map(encodeURIComponent).join('/'); +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ - db.request({ - method: 'DELETE', - url: url - }, callback); -} +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } -function getArguments(fun) { - return function () { - var len = arguments.length; - var args = new Array(len); - var i = -1; - while (++i < len) { - args[i] = arguments[i]; - } - return fun.call(this, args); - }; -} -function callbackify(fun) { - return getArguments(function (args) { - var cb = args.pop(); - var promise = fun.apply(this, args); - promisedCallback(promise, cb); - return promise; - }); -} + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -function promisedCallback(promise, callback) { - promise.then(function (res) { - process.nextTick(function () { - callback(null, res); - }); - }, function (reason) { - process.nextTick(function () { - callback(reason); - }); - }); - return promise; + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } -var flatten = getArguments(function (args) { - var res = []; - for (var i = 0, len = args.length; i < len; i++) { - var subArr = args[i]; - if (Array.isArray(subArr)) { - res = res.concat(flatten.apply(null, subArr)); - } else { - res.push(subArr); - } - } - return res; -}); +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ -function mergeObjects(arr) { - var res = {}; - for (var i = 0, len = arr.length; i < len; i++) { - res = pouchdbUtils.assign(res, arr[i]); +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; } - return res; -} +}; -// Selects a list of fields defined in dot notation from one doc -// and copies them to a new doc. Like underscore _.pick but supports nesting. -function pick(obj, arr) { - var res = {}; - for (var i = 0, len = arr.length; i < len; i++) { - var parsedField = pouchdbSelectorCore.parseField(arr[i]); - var value = pouchdbSelectorCore.getFieldFromDoc(obj, parsedField); - if (typeof value !== 'undefined') { - pouchdbSelectorCore.setFieldInDoc(res, parsedField, value); - } - } - return res; -} -// e.g. ['a'], ['a', 'b'] is true, but ['b'], ['a', 'b'] is false -function oneArrayIsSubArrayOfOther(left, right) { +/** + * Colorize log arguments if enabled. + * + * @api public + */ - for (var i = 0, len = Math.min(left.length, right.length); i < len; i++) { - if (left[i] !== right[i]) { - return false; - } - } - return true; -} +function formatArgs(args) { + var useColors = this.useColors; -// e.g.['a', 'b', 'c'], ['a', 'b'] is false -function oneArrayIsStrictSubArrayOfOther(left, right) { + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); - if (left.length > right.length) { - return false; - } + if (!useColors) return; - return oneArrayIsSubArrayOfOther(left, right); -} + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') -// same as above, but treat the left array as an unordered set -// e.g. ['b', 'a'], ['a', 'b', 'c'] is true, but ['c'], ['a', 'b', 'c'] is false -function oneSetIsSubArrayOfOther(left, right) { - left = left.slice(); - for (var i = 0, len = right.length; i < len; i++) { - var field = right[i]; - if (!left.length) { - break; - } - var leftIdx = left.indexOf(field); - if (leftIdx === -1) { - return false; - } else { - left.splice(leftIdx, 1); + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; } - } - return true; -} + }); -function arrayToObject(arr) { - var res = {}; - for (var i = 0, len = arr.length; i < len; i++) { - res[arr[i]] = true; - } - return res; + args.splice(lastC, 0, c); } -function max(arr, fun) { - var max = null; - var maxScore = -1; - for (var i = 0, len = arr.length; i < len; i++) { - var element = arr[i]; - var score = fun(element); - if (score > maxScore) { - maxScore = score; - max = element; - } - } - return max; +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); } -function arrayEquals(arr1, arr2) { - if (arr1.length !== arr2.length) { - return false; - } - for (var i = 0, len = arr1.length; i < len; i++) { - if (arr1[i] !== arr2[i]) { - return false; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; } - } - return true; + } catch(e) {} } -function uniq(arr) { - var obj = {}; - for (var i = 0; i < arr.length; i++) { - obj['$' + arr[i]] = true; - } - return Object.keys(obj).map(function (key) { - return key.substring(1); - }); -} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ -// -// One thing about these mappers: -// -// Per the advice of John-David Dalton (http://youtu.be/NthmeLEhDDM), -// what you want to do in this case is optimize for the smallest possible -// function, since that's the thing that gets run over and over again. -// -// This code would be a lot simpler if all the if/elses were inside -// the function, but it would also be a lot less performant. -// +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -function createDeepMultiMapper(fields, emit) { - return function (doc) { - var toEmit = []; - for (var i = 0, iLen = fields.length; i < iLen; i++) { - var parsedField = pouchdbSelectorCore.parseField(fields[i]); - var value = doc; - for (var j = 0, jLen = parsedField.length; j < jLen; j++) { - var key = parsedField[j]; - value = value[key]; - if (!value) { - return; // don't emit - } - } - toEmit.push(value); - } - emit(toEmit); - }; + return r; } -function createDeepSingleMapper(field, emit) { - var parsedField = pouchdbSelectorCore.parseField(field); - return function (doc) { - var value = doc; - for (var i = 0, len = parsedField.length; i < len; i++) { - var key = parsedField[i]; - value = value[key]; - if (!value) { - return; // do nothing - } - } - emit(value); - }; -} +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ -function createShallowSingleMapper(field, emit) { - return function (doc) { - emit(doc[field]); - }; -} +exports.enable(load()); -function createShallowMultiMapper(fields, emit) { - return function (doc) { - var toEmit = []; - for (var i = 0, len = fields.length; i < len; i++) { - toEmit.push(doc[fields[i]]); - } - emit(toEmit); - }; -} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ -function checkShallow(fields) { - for (var i = 0, len = fields.length; i < len; i++) { - var field = fields[i]; - if (field.indexOf('.') !== -1) { - return false; - } - } - return true; +function localstorage() { + try { + return window.localStorage; + } catch (e) {} } -function createMapper(fields, emit) { - var isShallow = checkShallow(fields); - var isSingle = fields.length === 1; +}).call(this,require('_process')) +},{"./debug":535,"_process":594}],535:[function(require,module,exports){ - // notice we try to optimize for the most common case, - // i.e. single shallow indexes - if (isShallow) { - if (isSingle) { - return createShallowSingleMapper(fields[0], emit); - } else { // multi - return createShallowMultiMapper(fields, emit); - } - } else { // deep - if (isSingle) { - return createDeepSingleMapper(fields[0], emit); - } else { // multi - return createDeepMultiMapper(fields, emit); - } - } -} +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ -function mapper(mapFunDef, emit) { - // mapFunDef is a list of fields +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); - var fields = Object.keys(mapFunDef.fields); +/** + * Active `debug` instances. + */ +exports.instances = []; - return createMapper(fields, emit); -} +/** + * The currently active debug mode names, and names to skip. + */ -/* istanbul ignore next */ -function reducer(/*reduceFunDef*/) { - throw new Error('reduce not supported'); -} +exports.names = []; +exports.skips = []; -function ddocValidator(ddoc, viewName) { - var view = ddoc.views[viewName]; - // This doesn't actually need to be here apparently, but - // I feel safer keeping it. - /* istanbul ignore if */ - if (!view.map || !view.map.fields) { - throw new Error('ddoc ' + ddoc._id +' with view ' + viewName + - ' doesn\'t have map.fields defined. ' + - 'maybe it wasn\'t created by this plugin?'); - } -} +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ -var abstractMapper = abstractMapReduce( - /* localDocName */ 'indexes', - mapper, - reducer, - ddocValidator -); +exports.formatters = {}; -// normalize the "sort" value -function massageSort(sort) { - if (!Array.isArray(sort)) { - throw new Error('invalid sort json - should be an array'); - } - return sort.map(function (sorting) { - if (typeof sorting === 'string') { - var obj = {}; - obj[sorting] = 'asc'; - return obj; - } else { - return sorting; - } - }); -} +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ -function massageUseIndex(useIndex) { - var cleanedUseIndex = []; - if (typeof useIndex === 'string') { - cleanedUseIndex.push(useIndex); - } else { - cleanedUseIndex = useIndex; +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer } - return cleanedUseIndex.map(function (name) { - return name.replace('_design/', ''); - }); + return exports.colors[Math.abs(hash) % exports.colors.length]; } -function massageIndexDef(indexDef) { - indexDef.fields = indexDef.fields.map(function (field) { - if (typeof field === 'string') { - var obj = {}; - obj[field] = 'asc'; - return obj; - } - return field; - }); - return indexDef; -} +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ -function getKeyFromDoc(doc, index) { - var res = []; - for (var i = 0; i < index.def.fields.length; i++) { - var field = pouchdbSelectorCore.getKey(index.def.fields[i]); - res.push(doc[field]); - } - return res; -} +function createDebug(namespace) { -// have to do this manually because REASONS. I don't know why -// CouchDB didn't implement inclusive_start -function filterInclusiveStart(rows, targetValue, index) { - var indexFields = index.def.fields; - for (var i = 0, len = rows.length; i < len; i++) { - var row = rows[i]; + var prevTime; - // shave off any docs at the beginning that are <= the - // target value + function debug() { + // disabled? + if (!debug.enabled) return; - var docKey = getKeyFromDoc(row.doc, index); - if (indexFields.length === 1) { - docKey = docKey[0]; // only one field, not multi-field - } else { // more than one field in index - // in the case where e.g. the user is searching {$gt: {a: 1}} - // but the index is [a, b], then we need to shorten the doc key - while (docKey.length > targetValue.length) { - docKey.pop(); - } - } - //ABS as we just looking for values that don't match - if (Math.abs(pouchdbCollate.collate(docKey, targetValue)) > 0) { - // no need to filter any further; we're past the key - break; + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; } - } - return i > 0 ? rows.slice(i) : rows; -} -function reverseOptions(opts) { - var newOpts = pouchdbUtils.clone(opts); - delete newOpts.startkey; - delete newOpts.endkey; - delete newOpts.inclusive_start; - delete newOpts.inclusive_end; + args[0] = exports.coerce(args[0]); - if ('endkey' in opts) { - newOpts.startkey = opts.endkey; - } - if ('startkey' in opts) { - newOpts.endkey = opts.startkey; - } - if ('inclusive_start' in opts) { - newOpts.inclusive_end = opts.inclusive_start; - } - if ('inclusive_end' in opts) { - newOpts.inclusive_start = opts.inclusive_end; - } - return newOpts; -} + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } -function validateIndex(index) { - var ascFields = index.fields.filter(function (field) { - return pouchdbSelectorCore.getValue(field) === 'asc'; - }); - if (ascFields.length !== 0 && ascFields.length !== index.fields.length) { - throw new Error('unsupported mixed sorting'); - } -} + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); -function validateSort(requestDef, index) { - if (index.defaultUsed && requestDef.sort) { - var noneIdSorts = requestDef.sort.filter(function (sortItem) { - return Object.keys(sortItem)[0] !== '_id'; - }).map(function (sortItem) { - return Object.keys(sortItem)[0]; + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; }); - if (noneIdSorts.length > 0) { - throw new Error('Cannot sort on field(s) "' + noneIdSorts.join(',') + - '" when using the default index'); - } - } + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); - if (index.defaultUsed) { - return; + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); } -} -function validateFindRequest(requestDef) { - if (typeof requestDef.selector !== 'object') { - throw new Error('you must provide a selector when you find()'); + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); } - /*var selectors = requestDef.selector['$and'] || [requestDef.selector]; - for (var i = 0; i < selectors.length; i++) { - var selector = selectors[i]; - var keys = Object.keys(selector); - if (keys.length === 0) { - throw new Error('invalid empty selector'); - } - //var selection = selector[keys[0]]; - /*if (Object.keys(selection).length !== 1) { - throw new Error('invalid selector: ' + JSON.stringify(selection) + - ' - it must have exactly one key/value'); - } - }*/ + exports.instances.push(debug); + + return debug; } -// determine the maximum number of fields -// we're going to need to query, e.g. if the user -// has selection ['a'] and sorting ['a', 'b'], then we -// need to use the longer of the two: ['a', 'b'] -function getUserFields(selector, sort) { - var selectorFields = Object.keys(selector); - var sortFields = sort? sort.map(pouchdbSelectorCore.getKey) : []; - var userFields; - if (selectorFields.length >= sortFields.length) { - userFields = selectorFields; +function destroy () { + var index = exports.instances.indexOf(this); + if (index !== -1) { + exports.instances.splice(index, 1); + return true; } else { - userFields = sortFields; - } - - if (sortFields.length === 0) { - return { - fields: userFields - }; + return false; } +} - // sort according to the user's preferred sorting - userFields = userFields.sort(function (left, right) { - var leftIdx = sortFields.indexOf(left); - if (leftIdx === -1) { - leftIdx = Number.MAX_VALUE; - } - var rightIdx = sortFields.indexOf(right); - if (rightIdx === -1) { - rightIdx = Number.MAX_VALUE; - } - return leftIdx < rightIdx ? -1 : leftIdx > rightIdx ? 1 : 0; - }); +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ - return { - fields: userFields, - sortOrder: sort.map(pouchdbSelectorCore.getKey) - }; -} +function enable(namespaces) { + exports.save(namespaces); -function createIndex$1(db, requestDef) { - requestDef = massageCreateIndexRequest(requestDef); - var originalIndexDef = pouchdbUtils.clone(requestDef.index); - requestDef.index = massageIndexDef(requestDef.index); + exports.names = []; + exports.skips = []; - validateIndex(requestDef.index); + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; - // calculating md5 is expensive - memoize and only - // run if required - var md5; - function getMd5() { - return md5 || (md5 = pouchdbMd5.stringMd5(JSON.stringify(requestDef))); + for (i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } } - var viewName = requestDef.name || ('idx-' + getMd5()); - - var ddocName = requestDef.ddoc || ('idx-' + getMd5()); - var ddocId = '_design/' + ddocName; + for (i = 0; i < exports.instances.length; i++) { + var instance = exports.instances[i]; + instance.enabled = exports.enabled(instance.namespace); + } +} - var hasInvalidLanguage = false; - var viewExists = false; +/** + * Disable debug output. + * + * @api public + */ - function updateDdoc(doc) { - if (doc._rev && doc.language !== 'query') { - hasInvalidLanguage = true; - } - doc.language = 'query'; - doc.views = doc.views || {}; +function disable() { + exports.enable(''); +} - viewExists = !!doc.views[viewName]; +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ - if (viewExists) { +function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { return false; } - - doc.views[viewName] = { - map: { - fields: mergeObjects(requestDef.index.fields) - }, - reduce: '_count', - options: { - def: originalIndexDef - } - }; - - return doc; } - - db.constructor.emit('debug', ['find', 'creating index', ddocId]); - - return pouchdbUtils.upsert(db, ddocId, updateDdoc).then(function () { - if (hasInvalidLanguage) { - throw new Error('invalid language for ddoc with id "' + - ddocId + - '" (should be "query")'); + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; } - }).then(function () { - // kick off a build - // TODO: abstract-pouchdb-mapreduce should support auto-updating - // TODO: should also use update_after, but pouchdb/pouchdb#3415 blocks me - var signature = ddocName + '/' + viewName; - return abstractMapper.query.call(db, signature, { - limit: 0, - reduce: false - }).then(function () { - return { - id: ddocId, - name: viewName, - result: viewExists ? 'exists' : 'created' - }; - }); - }); + } + return false; } -function getIndexes$1(db) { - // just search through all the design docs and filter in-memory. - // hopefully there aren't that many ddocs. - return db.allDocs({ - startkey: '_design/', - endkey: '_design/\uffff', - include_docs: true - }).then(function (allDocsRes) { - var res = { - indexes: [{ - ddoc: null, - name: '_all_docs', - type: 'special', - def: { - fields: [{_id: 'asc'}] - } - }] - }; +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ - res.indexes = flatten(res.indexes, allDocsRes.rows.filter(function (row) { - return row.doc.language === 'query'; - }).map(function (row) { - var viewNames = row.doc.views !== undefined ? Object.keys(row.doc.views) : []; +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} - return viewNames.map(function (viewName) { - var view = row.doc.views[viewName]; - return { - ddoc: row.id, - name: viewName, - type: 'json', - def: massageIndexDef(view.options.def) - }; - }); - })); +},{"ms":537}],536:[function(require,module,exports){ +arguments[4][501][0].apply(exports,arguments) +},{"dup":501}],537:[function(require,module,exports){ +/** + * Helpers. + */ - // these are sorted by view name for some reason - res.indexes.sort(function (left, right) { - return pouchdbSelectorCore.compare(left.name, right.name); - }); - res.total_rows = res.indexes.length; - return res; - }); -} +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; -// couchdb lowest collation value -var COLLATE_LO = null; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ -// couchdb highest collation value (TODO: well not really, but close enough amirite) -var COLLATE_HI = {"\uffff": {}}; +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; -// couchdb second-lowest collation value +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ -function checkFieldInIndex(index, field) { - var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); - for (var i = 0, len = indexFields.length; i < len; i++) { - var indexField = indexFields[i]; - if (field === indexField) { - return true; - } +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; } - return false; } -// so when you do e.g. $eq/$eq, we can do it entirely in the database. -// but when you do e.g. $gt/$eq, the first part can be done -// in the database, but the second part has to be done in-memory, -// because $gt has forced us to lose precision. -// so that's what this determines -function userOperatorLosesPrecision(selector, field) { - var matcher = selector[field]; - var userOperator = pouchdbSelectorCore.getKey(matcher); +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ - return userOperator !== '$eq'; +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; } -// sort the user fields by their position in the index, -// if they're in the index -function sortFieldsByIndex(userFields, index) { - var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ - return userFields.slice().sort(function (a, b) { - var aIdx = indexFields.indexOf(a); - var bIdx = indexFields.indexOf(b); - if (aIdx === -1) { - aIdx = Number.MAX_VALUE; - } - if (bIdx === -1) { - bIdx = Number.MAX_VALUE; - } - return pouchdbSelectorCore.compare(aIdx, bIdx); - }); +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; } -// first pass to try to find fields that will need to be sorted in-memory -function getBasicInMemoryFields(index, selector, userFields) { - - userFields = sortFieldsByIndex(userFields, index); +/** + * Pluralization helper. + */ - // check if any of the user selectors lose precision - var needToFilterInMemory = false; - for (var i = 0, len = userFields.length; i < len; i++) { - var field = userFields[i]; - if (needToFilterInMemory || !checkFieldInIndex(index, field)) { - return userFields.slice(i); - } - if (i < len - 1 && userOperatorLosesPrecision(selector, field)) { - needToFilterInMemory = true; - } +function plural(ms, n, name) { + if (ms < n) { + return; } - return []; + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; } -function getInMemoryFieldsFromNe(selector) { - var fields = []; - Object.keys(selector).forEach(function (field) { - var matcher = selector[field]; - Object.keys(matcher).forEach(function (operator) { - if (operator === '$ne') { - fields.push(field); - } - }); - }); - return fields; -} +},{}],538:[function(require,module,exports){ +'use strict'; -function getInMemoryFields(coreInMemoryFields, index, selector, userFields) { - var result = flatten( - // in-memory fields reported as necessary by the query planner - coreInMemoryFields, - // combine with another pass that checks for any we may have missed - getBasicInMemoryFields(index, selector, userFields), - // combine with another pass that checks for $ne's - getInMemoryFieldsFromNe(selector) - ); +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbErrors = require('pouchdb-errors'); +var pouchdbSelectorCore = require('pouchdb-selector-core'); - return sortFieldsByIndex(uniq(result), index); +function evalFilter(input) { + return pouchdbUtils.scopeEval('"use strict";\nreturn ' + input + ';', {}); } -// check that at least one field in the user's query is represented -// in the index. order matters in the case of sorts -function checkIndexFieldsMatch(indexFields, sortOrder, fields) { - if (sortOrder) { - // array has to be a strict subarray of index array. furthermore, - // the sortOrder fields need to all be represented in the index - var sortMatches = oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields); - var selectorMatches = oneArrayIsSubArrayOfOther(fields, indexFields); - - return sortMatches && selectorMatches; - } +function evalView(input) { + var code = [ + 'return function(doc) {', + ' "use strict";', + ' var emitted = false;', + ' var emit = function (a, b) {', + ' emitted = true;', + ' };', + ' var view = ' + input + ';', + ' view(doc);', + ' if (emitted) {', + ' return true;', + ' }', + '};' + ].join('\n'); - // all of the user's specified fields still need to be - // on the left side of the index array, although the order - // doesn't matter - return oneSetIsSubArrayOfOther(fields, indexFields); + return pouchdbUtils.scopeEval(code, {}); } -var logicalMatchers = ['$eq', '$gt', '$gte', '$lt', '$lte']; -function isNonLogicalMatcher(matcher) { - return logicalMatchers.indexOf(matcher) === -1; +function validate(opts, callback) { + if (opts.selector) { + if (opts.filter && opts.filter !== '_selector') { + var filterName = typeof opts.filter === 'string' ? + opts.filter : 'function'; + return callback(new Error('selector invalid for filter "' + filterName + '"')); + } + } + callback(); } -// check all the index fields for usages of '$ne' -// e.g. if the user queries {foo: {$ne: 'foo'}, bar: {$eq: 'bar'}}, -// then we can neither use an index on ['foo'] nor an index on -// ['foo', 'bar'], but we can use an index on ['bar'] or ['bar', 'foo'] -function checkFieldsLogicallySound(indexFields, selector) { - var firstField = indexFields[0]; - var matcher = selector[firstField]; - - if (typeof matcher === 'undefined') { - return true; +function normalize(opts) { + if (opts.view && !opts.filter) { + opts.filter = '_view'; } - var hasLogicalOperator = Object.keys(matcher).some(function (matcherKey) { - return !(isNonLogicalMatcher(matcherKey)); - }); - - if (!hasLogicalOperator) { - return false; + if (opts.selector && !opts.filter) { + opts.filter = '_selector'; } - var isInvalidNe = Object.keys(matcher).length === 1 && - pouchdbSelectorCore.getKey(matcher) === '$ne'; + if (opts.filter && typeof opts.filter === 'string') { + if (opts.filter === '_view') { + opts.view = pouchdbUtils.normalizeDdocFunctionName(opts.view); + } else { + opts.filter = pouchdbUtils.normalizeDdocFunctionName(opts.filter); + } + } +} - return !isInvalidNe; +function shouldFilter(changesHandler, opts) { + return opts.filter && typeof opts.filter === 'string' && + !opts.doc_ids && !pouchdbUtils.isRemote(changesHandler.db); } -function checkIndexMatches(index, sortOrder, fields, selector) { +function filter(changesHandler, opts) { + var callback = opts.complete; + if (opts.filter === '_view') { + if (!opts.view || typeof opts.view !== 'string') { + var err = pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, + '`view` filter parameter not found or invalid.'); + return callback(err); + } + // fetch a view from a design doc, make it behave like a filter + var viewName = pouchdbUtils.parseDdocFunctionName(opts.view); + changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) { + /* istanbul ignore if */ + if (changesHandler.isCancelled) { + return callback(null, {status: 'cancelled'}); + } + /* istanbul ignore next */ + if (err) { + return callback(pouchdbErrors.generateErrorFromResponse(err)); + } + var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] && + ddoc.views[viewName[1]].map; + if (!mapFun) { + return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, + (ddoc.views ? 'missing json key: ' + viewName[1] : + 'missing json key: views'))); + } + opts.filter = evalView(mapFun); + changesHandler.doChanges(opts); + }); + } else if (opts.selector) { + opts.filter = function (doc) { + return pouchdbSelectorCore.matchesSelector(doc, opts.selector); + }; + changesHandler.doChanges(opts); + } else { + // fetch a filter from a design doc + var filterName = pouchdbUtils.parseDdocFunctionName(opts.filter); + changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) { + /* istanbul ignore if */ + if (changesHandler.isCancelled) { + return callback(null, {status: 'cancelled'}); + } + /* istanbul ignore next */ + if (err) { + return callback(pouchdbErrors.generateErrorFromResponse(err)); + } + var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]]; + if (!filterFun) { + return callback(pouchdbErrors.createError(pouchdbErrors.MISSING_DOC, + ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1] + : 'missing json key: filters'))); + } + opts.filter = evalFilter(filterFun); + changesHandler.doChanges(opts); + }); + } +} - var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); +function applyChangesFilterPlugin(PouchDB) { + PouchDB._changesFilterPlugin = { + validate: validate, + normalize: normalize, + shouldFilter: shouldFilter, + filter: filter + }; +} - var fieldsMatch = checkIndexFieldsMatch(indexFields, sortOrder, fields); +module.exports = applyChangesFilterPlugin; - if (!fieldsMatch) { - return false; - } +},{"pouchdb-errors":541,"pouchdb-selector-core":582,"pouchdb-utils":544}],539:[function(require,module,exports){ +arguments[4][508][0].apply(exports,arguments) +},{"dup":508}],540:[function(require,module,exports){ +'use strict'; - return checkFieldsLogicallySound(indexFields, selector); -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -// -// the algorithm is very simple: -// take all the fields the user supplies, and if those fields -// are a strict subset of the fields in some index, -// then use that index -// -// -function findMatchingIndexes(selector, userFields, sortOrder, indexes) { +var debug = _interopDefault(require('debug')); - return indexes.reduce(function (res, index) { - var indexMatches = checkIndexMatches(index, sortOrder, userFields, selector); - if (indexMatches) { - res.push(index); +function debugPouch(PouchDB) { + PouchDB.debug = debug; + var logs = {}; + /* istanbul ignore next */ + PouchDB.on('debug', function (args) { + // first argument is log identifier + var logId = args[0]; + // rest should be passed verbatim to debug module + var logArgs = args.slice(1); + if (!logs[logId]) { + logs[logId] = debug('pouchdb:' + logId); } - return res; - }, []); + logs[logId].apply(null, logArgs); + }); } -// find the best index, i.e. the one that matches the most fields -// in the user's query -function findBestMatchingIndex(selector, userFields, sortOrder, indexes, useIndex) { +module.exports = debugPouch; - var matchingIndexes = findMatchingIndexes(selector, userFields, sortOrder, indexes); +},{"debug":534}],541:[function(require,module,exports){ +arguments[4][509][0].apply(exports,arguments) +},{"dup":509,"inherits":495}],542:[function(require,module,exports){ +arguments[4][525][0].apply(exports,arguments) +},{"dup":525}],543:[function(require,module,exports){ +arguments[4][510][0].apply(exports,arguments) +},{"dup":510,"lie":500}],544:[function(require,module,exports){ +arguments[4][511][0].apply(exports,arguments) +},{"argsarray":39,"dup":511,"events":491,"immediate":536,"inherits":495,"pouchdb-collections":539,"pouchdb-errors":541,"pouchdb-promise":543,"uuid":545}],545:[function(require,module,exports){ +arguments[4][512][0].apply(exports,arguments) +},{"./v1":548,"./v4":549,"dup":512}],546:[function(require,module,exports){ +arguments[4][513][0].apply(exports,arguments) +},{"dup":513}],547:[function(require,module,exports){ +arguments[4][514][0].apply(exports,arguments) +},{"dup":514}],548:[function(require,module,exports){ +arguments[4][515][0].apply(exports,arguments) +},{"./lib/bytesToUuid":546,"./lib/rng":547,"dup":515}],549:[function(require,module,exports){ +arguments[4][516][0].apply(exports,arguments) +},{"./lib/bytesToUuid":546,"./lib/rng":547,"dup":516}],550:[function(require,module,exports){ +(function (process){ +'use strict'; - if (matchingIndexes.length === 0) { - if (useIndex) { - throw { - error: "no_usable_index", - message: "There is no index available for this selector." - }; - } - //return `all_docs` as a default index; - //I'm assuming that _all_docs is always first - var defaultIndex = indexes[0]; - defaultIndex.defaultUsed = true; - return defaultIndex; - } - if (matchingIndexes.length === 1 && !useIndex) { - return matchingIndexes[0]; - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - var userFieldsMap = arrayToObject(userFields); +var pouchdbUtils = require('pouchdb-utils'); +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbSelectorCore = require('pouchdb-selector-core'); +var abstractMapReduce = _interopDefault(require('pouchdb-abstract-mapreduce')); +var pouchdbCollate = require('pouchdb-collate'); +var pouchdbMd5 = require('pouchdb-md5'); - function scoreIndex(index) { - var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); - var score = 0; - for (var i = 0, len = indexFields.length; i < len; i++) { - var indexField = indexFields[i]; - if (userFieldsMap[indexField]) { - score++; - } +// we restucture the supplied JSON considerably, because the official +// Mango API is very particular about a lot of this stuff, but we like +// to be liberal with what we accept in order to prevent mental +// breakdowns in our users +function massageCreateIndexRequest(requestDef) { + requestDef = pouchdbUtils.clone(requestDef); + + if (!requestDef.index) { + requestDef.index = {}; + } + + ['type', 'name', 'ddoc'].forEach(function (key) { + if (requestDef.index[key]) { + requestDef[key] = requestDef.index[key]; + delete requestDef.index[key]; } - return score; + }); + + if (requestDef.fields) { + requestDef.index.fields = requestDef.fields; + delete requestDef.fields; } - if (useIndex) { - var useIndexDdoc = '_design/' + useIndex[0]; - var useIndexName = useIndex.length === 2 ? useIndex[1] : false; - var index = matchingIndexes.find(function (index) { - if (useIndexName && index.ddoc === useIndexDdoc && useIndexName === index.name) { - return true; - } + if (!requestDef.type) { + requestDef.type = 'json'; + } + return requestDef; +} - if (index.ddoc === useIndexDdoc) { - return true; - } +function createIndex(db, requestDef, callback) { + requestDef = massageCreateIndexRequest(requestDef); - return false; - }); + db.request({ + method: 'POST', + url: '_index', + body: requestDef + }, callback); +} - if (!index) { - throw { - error: "unknown_error", - message: "Could not find that index or could not use that index for the query" - }; - } - return index; - } +function find(db, requestDef, callback) { + db.request({ + method: 'POST', + url: '_find', + body: requestDef + }, callback); +} - return max(matchingIndexes, scoreIndex); +function explain(db, requestDef, callback) { + db.request({ + method: 'POST', + url: '_explain', + body: requestDef + }, callback); } -function getSingleFieldQueryOptsFor(userOperator, userValue) { - switch (userOperator) { - case '$eq': - return {key: userValue}; - case '$lte': - return {endkey: userValue}; - case '$gte': - return {startkey: userValue}; - case '$lt': - return { - endkey: userValue, - inclusive_end: false - }; - case '$gt': - return { - startkey: userValue, - inclusive_start: false - }; - } +function getIndexes(db, callback) { + db.request({ + method: 'GET', + url: '_index' + }, callback); } -function getSingleFieldCoreQueryPlan(selector, index) { - var field = pouchdbSelectorCore.getKey(index.def.fields[0]); - //ignoring this because the test to exercise the branch is skipped at the moment - /* istanbul ignore next */ - var matcher = selector[field] || {}; - var inMemoryFields = []; +function deleteIndex(db, indexDef, callback) { - var userOperators = Object.keys(matcher); - var combinedOpts; + var ddoc = indexDef.ddoc; + var type = indexDef.type || 'json'; + var name = indexDef.name; - userOperators.forEach(function (userOperator) { + if (!ddoc) { + return callback(new Error('you must provide an index\'s ddoc')); + } - if (isNonLogicalMatcher(userOperator)) { - inMemoryFields.push(field); - return; - } + if (!name) { + return callback(new Error('you must provide an index\'s name')); + } - var userValue = matcher[userOperator]; + var url = '_index/' + [ddoc, type, name].map(encodeURIComponent).join('/'); - var newQueryOpts = getSingleFieldQueryOptsFor(userOperator, userValue); + db.request({ + method: 'DELETE', + url: url + }, callback); +} - if (combinedOpts) { - combinedOpts = mergeObjects([combinedOpts, newQueryOpts]); - } else { - combinedOpts = newQueryOpts; +function getArguments(fun) { + return function () { + var len = arguments.length; + var args = new Array(len); + var i = -1; + while (++i < len) { + args[i] = arguments[i]; } - }); - - return { - queryOpts: combinedOpts, - inMemoryFields: inMemoryFields + return fun.call(this, args); }; } - -function getMultiFieldCoreQueryPlan(userOperator, userValue) { - switch (userOperator) { - case '$eq': - return { - startkey: userValue, - endkey: userValue - }; - case '$lte': - return { - endkey: userValue - }; - case '$gte': - return { - startkey: userValue - }; - case '$lt': - return { - endkey: userValue, - inclusive_end: false - }; - case '$gt': - return { - startkey: userValue, - inclusive_start: false - }; - } +function callbackify(fun) { + return getArguments(function (args) { + var cb = args.pop(); + var promise = fun.apply(this, args); + promisedCallback(promise, cb); + return promise; + }); } -function getMultiFieldQueryOpts(selector, index) { +function promisedCallback(promise, callback) { + promise.then(function (res) { + process.nextTick(function () { + callback(null, res); + }); + }, function (reason) { + process.nextTick(function () { + callback(reason); + }); + }); + return promise; +} - var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); +var flatten = getArguments(function (args) { + var res = []; + for (var i = 0, len = args.length; i < len; i++) { + var subArr = args[i]; + if (Array.isArray(subArr)) { + res = res.concat(flatten.apply(null, subArr)); + } else { + res.push(subArr); + } + } + return res; +}); - var inMemoryFields = []; - var startkey = []; - var endkey = []; - var inclusiveStart; - var inclusiveEnd; +function mergeObjects(arr) { + var res = {}; + for (var i = 0, len = arr.length; i < len; i++) { + res = pouchdbUtils.assign(res, arr[i]); + } + return res; +} +// Selects a list of fields defined in dot notation from one doc +// and copies them to a new doc. Like underscore _.pick but supports nesting. +function pick(obj, arr) { + var res = {}; + for (var i = 0, len = arr.length; i < len; i++) { + var parsedField = pouchdbSelectorCore.parseField(arr[i]); + var value = pouchdbSelectorCore.getFieldFromDoc(obj, parsedField); + if (typeof value !== 'undefined') { + pouchdbSelectorCore.setFieldInDoc(res, parsedField, value); + } + } + return res; +} - function finish(i) { +// e.g. ['a'], ['a', 'b'] is true, but ['b'], ['a', 'b'] is false +function oneArrayIsSubArrayOfOther(left, right) { - if (inclusiveStart !== false) { - startkey.push(COLLATE_LO); - } - if (inclusiveEnd !== false) { - endkey.push(COLLATE_HI); + for (var i = 0, len = Math.min(left.length, right.length); i < len; i++) { + if (left[i] !== right[i]) { + return false; } - // keep track of the fields where we lost specificity, - // and therefore need to filter in-memory - inMemoryFields = indexFields.slice(i); } + return true; +} - for (var i = 0, len = indexFields.length; i < len; i++) { - var indexField = indexFields[i]; +// e.g.['a', 'b', 'c'], ['a', 'b'] is false +function oneArrayIsStrictSubArrayOfOther(left, right) { - var matcher = selector[indexField]; + if (left.length > right.length) { + return false; + } - if (!matcher || !Object.keys(matcher).length) { // fewer fields in user query than in index - finish(i); + return oneArrayIsSubArrayOfOther(left, right); +} + +// same as above, but treat the left array as an unordered set +// e.g. ['b', 'a'], ['a', 'b', 'c'] is true, but ['c'], ['a', 'b', 'c'] is false +function oneSetIsSubArrayOfOther(left, right) { + left = left.slice(); + for (var i = 0, len = right.length; i < len; i++) { + var field = right[i]; + if (!left.length) { break; - } else if (i > 0) { - if (Object.keys(matcher).some(isNonLogicalMatcher)) { // non-logical are ignored - finish(i); - break; - } - var usingGtlt = ( - '$gt' in matcher || '$gte' in matcher || - '$lt' in matcher || '$lte' in matcher); - var previousKeys = Object.keys(selector[indexFields[i - 1]]); - var previousWasEq = arrayEquals(previousKeys, ['$eq']); - var previousWasSame = arrayEquals(previousKeys, Object.keys(matcher)); - var gtltLostSpecificity = usingGtlt && !previousWasEq && !previousWasSame; - if (gtltLostSpecificity) { - finish(i); - break; - } } + var leftIdx = left.indexOf(field); + if (leftIdx === -1) { + return false; + } else { + left.splice(leftIdx, 1); + } + } + return true; +} - var userOperators = Object.keys(matcher); +function arrayToObject(arr) { + var res = {}; + for (var i = 0, len = arr.length; i < len; i++) { + res[arr[i]] = true; + } + return res; +} - var combinedOpts = null; +function max(arr, fun) { + var max = null; + var maxScore = -1; + for (var i = 0, len = arr.length; i < len; i++) { + var element = arr[i]; + var score = fun(element); + if (score > maxScore) { + maxScore = score; + max = element; + } + } + return max; +} - for (var j = 0; j < userOperators.length; j++) { - var userOperator = userOperators[j]; - var userValue = matcher[userOperator]; +function arrayEquals(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (var i = 0, len = arr1.length; i < len; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} - var newOpts = getMultiFieldCoreQueryPlan(userOperator, userValue); +function uniq(arr) { + var obj = {}; + for (var i = 0; i < arr.length; i++) { + obj['$' + arr[i]] = true; + } + return Object.keys(obj).map(function (key) { + return key.substring(1); + }); +} - if (combinedOpts) { - combinedOpts = mergeObjects([combinedOpts, newOpts]); - } else { - combinedOpts = newOpts; +// +// One thing about these mappers: +// +// Per the advice of John-David Dalton (http://youtu.be/NthmeLEhDDM), +// what you want to do in this case is optimize for the smallest possible +// function, since that's the thing that gets run over and over again. +// +// This code would be a lot simpler if all the if/elses were inside +// the function, but it would also be a lot less performant. +// + + +function createDeepMultiMapper(fields, emit) { + return function (doc) { + var toEmit = []; + for (var i = 0, iLen = fields.length; i < iLen; i++) { + var parsedField = pouchdbSelectorCore.parseField(fields[i]); + var value = doc; + for (var j = 0, jLen = parsedField.length; j < jLen; j++) { + var key = parsedField[j]; + value = value[key]; + if (typeof value === 'undefined') { + return; // don't emit + } } + toEmit.push(value); } + emit(toEmit); + }; +} - startkey.push('startkey' in combinedOpts ? combinedOpts.startkey : COLLATE_LO); - endkey.push('endkey' in combinedOpts ? combinedOpts.endkey : COLLATE_HI); - if ('inclusive_start' in combinedOpts) { - inclusiveStart = combinedOpts.inclusive_start; - } - if ('inclusive_end' in combinedOpts) { - inclusiveEnd = combinedOpts.inclusive_end; +function createDeepSingleMapper(field, emit) { + var parsedField = pouchdbSelectorCore.parseField(field); + return function (doc) { + var value = doc; + for (var i = 0, len = parsedField.length; i < len; i++) { + var key = parsedField[i]; + value = value[key]; + if (typeof value === 'undefined') { + return; // do nothing + } } - } - - var res = { - startkey: startkey, - endkey: endkey + emit(value); }; +} - if (typeof inclusiveStart !== 'undefined') { - res.inclusive_start = inclusiveStart; - } - if (typeof inclusiveEnd !== 'undefined') { - res.inclusive_end = inclusiveEnd; - } - - return { - queryOpts: res, - inMemoryFields: inMemoryFields +function createShallowSingleMapper(field, emit) { + return function (doc) { + emit(doc[field]); }; } -function getDefaultQueryPlan(selector) { - //using default index, so all fields need to be done in memory - return { - queryOpts: {startkey: null}, - inMemoryFields: [Object.keys(selector)] +function createShallowMultiMapper(fields, emit) { + return function (doc) { + var toEmit = []; + for (var i = 0, len = fields.length; i < len; i++) { + toEmit.push(doc[fields[i]]); + } + emit(toEmit); }; } -function getCoreQueryPlan(selector, index) { - if (index.defaultUsed) { - return getDefaultQueryPlan(selector, index); +function checkShallow(fields) { + for (var i = 0, len = fields.length; i < len; i++) { + var field = fields[i]; + if (field.indexOf('.') !== -1) { + return false; + } } + return true; +} - if (index.def.fields.length === 1) { - // one field in index, so the value was indexed as a singleton - return getSingleFieldCoreQueryPlan(selector, index); +function createMapper(fields, emit) { + var isShallow = checkShallow(fields); + var isSingle = fields.length === 1; + + // notice we try to optimize for the most common case, + // i.e. single shallow indexes + if (isShallow) { + if (isSingle) { + return createShallowSingleMapper(fields[0], emit); + } else { // multi + return createShallowMultiMapper(fields, emit); + } + } else { // deep + if (isSingle) { + return createDeepSingleMapper(fields[0], emit); + } else { // multi + return createDeepMultiMapper(fields, emit); + } } - // else index has multiple fields, so the value was indexed as an array - return getMultiFieldQueryOpts(selector, index); } -function planQuery(request, indexes) { +function mapper(mapFunDef, emit) { + // mapFunDef is a list of fields - var selector = request.selector; - var sort = request.sort; + var fields = Object.keys(mapFunDef.fields); - var userFieldsRes = getUserFields(selector, sort); + return createMapper(fields, emit); +} - var userFields = userFieldsRes.fields; - var sortOrder = userFieldsRes.sortOrder; - var index = findBestMatchingIndex(selector, userFields, sortOrder, indexes, request.use_index); +/* istanbul ignore next */ +function reducer(/*reduceFunDef*/) { + throw new Error('reduce not supported'); +} - var coreQueryPlan = getCoreQueryPlan(selector, index); - var queryOpts = coreQueryPlan.queryOpts; - var coreInMemoryFields = coreQueryPlan.inMemoryFields; +function ddocValidator(ddoc, viewName) { + var view = ddoc.views[viewName]; + // This doesn't actually need to be here apparently, but + // I feel safer keeping it. + /* istanbul ignore if */ + if (!view.map || !view.map.fields) { + throw new Error('ddoc ' + ddoc._id +' with view ' + viewName + + ' doesn\'t have map.fields defined. ' + + 'maybe it wasn\'t created by this plugin?'); + } +} - var inMemoryFields = getInMemoryFields(coreInMemoryFields, index, selector, userFields); +var abstractMapper = abstractMapReduce( + /* localDocName */ 'indexes', + mapper, + reducer, + ddocValidator +); - var res = { - queryOpts: queryOpts, - index: index, - inMemoryFields: inMemoryFields - }; - return res; +// normalize the "sort" value +function massageSort(sort) { + if (!Array.isArray(sort)) { + throw new Error('invalid sort json - should be an array'); + } + return sort.map(function (sorting) { + if (typeof sorting === 'string') { + var obj = {}; + obj[sorting] = 'asc'; + return obj; + } else { + return sorting; + } + }); } -function indexToSignature(index) { - // remove '_design/' - return index.ddoc.substring(8) + '/' + index.name; +function massageUseIndex(useIndex) { + var cleanedUseIndex = []; + if (typeof useIndex === 'string') { + cleanedUseIndex.push(useIndex); + } else { + cleanedUseIndex = useIndex; + } + + return cleanedUseIndex.map(function (name) { + return name.replace('_design/', ''); + }); } -function doAllDocs(db, originalOpts) { - var opts = pouchdbUtils.clone(originalOpts); +function massageIndexDef(indexDef) { + indexDef.fields = indexDef.fields.map(function (field) { + if (typeof field === 'string') { + var obj = {}; + obj[field] = 'asc'; + return obj; + } + return field; + }); + return indexDef; +} - // CouchDB responds in weird ways when you provide a non-string to _id; - // we mimic the behavior for consistency. See issue66 tests for details. +function getKeyFromDoc(doc, index) { + var res = []; + for (var i = 0; i < index.def.fields.length; i++) { + var field = pouchdbSelectorCore.getKey(index.def.fields[i]); + res.push(doc[field]); + } + return res; +} - if (opts.descending) { - if ('endkey' in opts && typeof opts.endkey !== 'string') { - opts.endkey = ''; - } - if ('startkey' in opts && typeof opts.startkey !== 'string') { - opts.limit = 0; - } - } else { - if ('startkey' in opts && typeof opts.startkey !== 'string') { - opts.startkey = ''; +// have to do this manually because REASONS. I don't know why +// CouchDB didn't implement inclusive_start +function filterInclusiveStart(rows, targetValue, index) { + var indexFields = index.def.fields; + for (var i = 0, len = rows.length; i < len; i++) { + var row = rows[i]; + + // shave off any docs at the beginning that are <= the + // target value + + var docKey = getKeyFromDoc(row.doc, index); + if (indexFields.length === 1) { + docKey = docKey[0]; // only one field, not multi-field + } else { // more than one field in index + // in the case where e.g. the user is searching {$gt: {a: 1}} + // but the index is [a, b], then we need to shorten the doc key + while (docKey.length > targetValue.length) { + docKey.pop(); + } } - if ('endkey' in opts && typeof opts.endkey !== 'string') { - opts.limit = 0; + //ABS as we just looking for values that don't match + if (Math.abs(pouchdbCollate.collate(docKey, targetValue)) > 0) { + // no need to filter any further; we're past the key + break; } } - if ('key' in opts && typeof opts.key !== 'string') { - opts.limit = 0; + return i > 0 ? rows.slice(i) : rows; +} + +function reverseOptions(opts) { + var newOpts = pouchdbUtils.clone(opts); + delete newOpts.startkey; + delete newOpts.endkey; + delete newOpts.inclusive_start; + delete newOpts.inclusive_end; + + if ('endkey' in opts) { + newOpts.startkey = opts.endkey; + } + if ('startkey' in opts) { + newOpts.endkey = opts.startkey; + } + if ('inclusive_start' in opts) { + newOpts.inclusive_end = opts.inclusive_start; + } + if ('inclusive_end' in opts) { + newOpts.inclusive_start = opts.inclusive_end; } + return newOpts; +} - return db.allDocs(opts) - .then(function (res) { - // filter out any design docs that _all_docs might return - res.rows = res.rows.filter(function (row) { - return !/^_design\//.test(row.id); - }); - return res; +function validateIndex(index) { + var ascFields = index.fields.filter(function (field) { + return pouchdbSelectorCore.getValue(field) === 'asc'; }); + if (ascFields.length !== 0 && ascFields.length !== index.fields.length) { + throw new Error('unsupported mixed sorting'); + } } -function find$1(db, requestDef, explain) { - if (requestDef.selector) { - requestDef.selector = pouchdbSelectorCore.massageSelector(requestDef.selector); +function validateSort(requestDef, index) { + if (index.defaultUsed && requestDef.sort) { + var noneIdSorts = requestDef.sort.filter(function (sortItem) { + return Object.keys(sortItem)[0] !== '_id'; + }).map(function (sortItem) { + return Object.keys(sortItem)[0]; + }); + + if (noneIdSorts.length > 0) { + throw new Error('Cannot sort on field(s) "' + noneIdSorts.join(',') + + '" when using the default index'); + } } - if (requestDef.sort) { - requestDef.sort = massageSort(requestDef.sort); + if (index.defaultUsed) { + return; } +} - if (requestDef.use_index) { - requestDef.use_index = massageUseIndex(requestDef.use_index); +function validateFindRequest(requestDef) { + if (typeof requestDef.selector !== 'object') { + throw new Error('you must provide a selector when you find()'); } - validateFindRequest(requestDef); + /*var selectors = requestDef.selector['$and'] || [requestDef.selector]; + for (var i = 0; i < selectors.length; i++) { + var selector = selectors[i]; + var keys = Object.keys(selector); + if (keys.length === 0) { + throw new Error('invalid empty selector'); + } + //var selection = selector[keys[0]]; + /*if (Object.keys(selection).length !== 1) { + throw new Error('invalid selector: ' + JSON.stringify(selection) + + ' - it must have exactly one key/value'); + } + }*/ +} - return getIndexes$1(db).then(function (getIndexesRes) { +// determine the maximum number of fields +// we're going to need to query, e.g. if the user +// has selection ['a'] and sorting ['a', 'b'], then we +// need to use the longer of the two: ['a', 'b'] +function getUserFields(selector, sort) { + var selectorFields = Object.keys(selector); + var sortFields = sort? sort.map(pouchdbSelectorCore.getKey) : []; + var userFields; + if (selectorFields.length >= sortFields.length) { + userFields = selectorFields; + } else { + userFields = sortFields; + } - db.constructor.emit('debug', ['find', 'planning query', requestDef]); - var queryPlan = planQuery(requestDef, getIndexesRes.indexes); - db.constructor.emit('debug', ['find', 'query plan', queryPlan]); + if (sortFields.length === 0) { + return { + fields: userFields + }; + } - var indexToUse = queryPlan.index; + // sort according to the user's preferred sorting + userFields = userFields.sort(function (left, right) { + var leftIdx = sortFields.indexOf(left); + if (leftIdx === -1) { + leftIdx = Number.MAX_VALUE; + } + var rightIdx = sortFields.indexOf(right); + if (rightIdx === -1) { + rightIdx = Number.MAX_VALUE; + } + return leftIdx < rightIdx ? -1 : leftIdx > rightIdx ? 1 : 0; + }); - validateSort(requestDef, indexToUse); + return { + fields: userFields, + sortOrder: sort.map(pouchdbSelectorCore.getKey) + }; +} - var opts = pouchdbUtils.assign({ - include_docs: true, - reduce: false - }, queryPlan.queryOpts); +function createIndex$1(db, requestDef) { + requestDef = massageCreateIndexRequest(requestDef); + var originalIndexDef = pouchdbUtils.clone(requestDef.index); + requestDef.index = massageIndexDef(requestDef.index); - if ('startkey' in opts && 'endkey' in opts && - pouchdbCollate.collate(opts.startkey, opts.endkey) > 0) { - // can't possibly return any results, startkey > endkey - return {docs: []}; - } + validateIndex(requestDef.index); - var isDescending = requestDef.sort && - typeof requestDef.sort[0] !== 'string' && - pouchdbSelectorCore.getValue(requestDef.sort[0]) === 'desc'; + // calculating md5 is expensive - memoize and only + // run if required + var md5; + function getMd5() { + return md5 || (md5 = pouchdbMd5.stringMd5(JSON.stringify(requestDef))); + } - if (isDescending) { - // either all descending or all ascending - opts.descending = true; - opts = reverseOptions(opts); - } + var viewName = requestDef.name || ('idx-' + getMd5()); - if (!queryPlan.inMemoryFields.length) { - // no in-memory filtering necessary, so we can let the - // database do the limit/skip for us - if ('limit' in requestDef) { - opts.limit = requestDef.limit; - } - if ('skip' in requestDef) { - opts.skip = requestDef.skip; - } + var ddocName = requestDef.ddoc || ('idx-' + getMd5()); + var ddocId = '_design/' + ddocName; + + var hasInvalidLanguage = false; + var viewExists = false; + + function updateDdoc(doc) { + if (doc._rev && doc.language !== 'query') { + hasInvalidLanguage = true; } + doc.language = 'query'; + doc.views = doc.views || {}; - if (explain) { - return Promise.resolve(queryPlan, opts); + viewExists = !!doc.views[viewName]; + + if (viewExists) { + return false; } - return Promise.resolve().then(function () { - if (indexToUse.name === '_all_docs') { - return doAllDocs(db, opts); - } else { - var signature = indexToSignature(indexToUse); - return abstractMapper.query.call(db, signature, opts); - } - }).then(function (res) { - if (opts.inclusive_start === false) { - // may have to manually filter the first one, - // since couchdb has no true inclusive_start option - res.rows = filterInclusiveStart(res.rows, opts.startkey, indexToUse); - } - - if (queryPlan.inMemoryFields.length) { - // need to filter some stuff in-memory - res.rows = pouchdbSelectorCore.filterInMemoryFields(res.rows, requestDef, queryPlan.inMemoryFields); + doc.views[viewName] = { + map: { + fields: mergeObjects(requestDef.index.fields) + }, + reduce: '_count', + options: { + def: originalIndexDef } + }; - var resp = { - docs: res.rows.map(function (row) { - var doc = row.doc; - if (requestDef.fields) { - return pick(doc, requestDef.fields); - } - return doc; - }) - }; + return doc; + } - if (indexToUse.defaultUsed) { - resp.warning = 'no matching index found, create an index to optimize query time'; - } + db.constructor.emit('debug', ['find', 'creating index', ddocId]); - return resp; + return pouchdbUtils.upsert(db, ddocId, updateDdoc).then(function () { + if (hasInvalidLanguage) { + throw new Error('invalid language for ddoc with id "' + + ddocId + + '" (should be "query")'); + } + }).then(function () { + // kick off a build + // TODO: abstract-pouchdb-mapreduce should support auto-updating + // TODO: should also use update_after, but pouchdb/pouchdb#3415 blocks me + var signature = ddocName + '/' + viewName; + return abstractMapper.query.call(db, signature, { + limit: 0, + reduce: false + }).then(function () { + return { + id: ddocId, + name: viewName, + result: viewExists ? 'exists' : 'created' + }; }); }); } -function explain$1(db, requestDef) { - return find$1(db, requestDef, true) - .then(function (queryPlan) { - return { - dbname: db.name, - index: queryPlan.index, - selector: requestDef.selector, - range: { - start_key: queryPlan.queryOpts.startkey, - end_key: queryPlan.queryOpts.endkey, - }, - opts: { - use_index: requestDef.use_index || [], - bookmark: "nil", //hardcoded to match CouchDB since its not supported, - limit: requestDef.limit, - skip: requestDef.skip, - sort: requestDef.sort || {}, - fields: requestDef.fields, - conflicts: false, //hardcoded to match CouchDB since its not supported, - r: [49], // hardcoded to match CouchDB since its not support - }, - limit: requestDef.limit, - skip: requestDef.skip || 0, - fields: requestDef.fields, +function getIndexes$1(db) { + // just search through all the design docs and filter in-memory. + // hopefully there aren't that many ddocs. + return db.allDocs({ + startkey: '_design/', + endkey: '_design/\uffff', + include_docs: true + }).then(function (allDocsRes) { + var res = { + indexes: [{ + ddoc: null, + name: '_all_docs', + type: 'special', + def: { + fields: [{_id: 'asc'}] + } + }] }; + + res.indexes = flatten(res.indexes, allDocsRes.rows.filter(function (row) { + return row.doc.language === 'query'; + }).map(function (row) { + var viewNames = row.doc.views !== undefined ? Object.keys(row.doc.views) : []; + + return viewNames.map(function (viewName) { + var view = row.doc.views[viewName]; + return { + ddoc: row.id, + name: viewName, + type: 'json', + def: massageIndexDef(view.options.def) + }; + }); + })); + + // these are sorted by view name for some reason + res.indexes.sort(function (left, right) { + return pouchdbSelectorCore.compare(left.name, right.name); + }); + res.total_rows = res.indexes.length; + return res; }); } -function deleteIndex$1(db, index) { - - if (!index.ddoc) { - throw new Error('you must supply an index.ddoc when deleting'); - } +// couchdb lowest collation value +var COLLATE_LO = null; - if (!index.name) { - throw new Error('you must supply an index.name when deleting'); - } +// couchdb highest collation value (TODO: well not really, but close enough amirite) +var COLLATE_HI = {"\uffff": {}}; - var docId = index.ddoc; - var viewName = index.name; +// couchdb second-lowest collation value - function deltaFun(doc) { - if (Object.keys(doc.views).length === 1 && doc.views[viewName]) { - // only one view in this ddoc, delete the whole ddoc - return {_id: docId, _deleted: true}; +function checkFieldInIndex(index, field) { + var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); + for (var i = 0, len = indexFields.length; i < len; i++) { + var indexField = indexFields[i]; + if (field === indexField) { + return true; } - // more than one view here, just remove the view - delete doc.views[viewName]; - return doc; } + return false; +} - return pouchdbUtils.upsert(db, docId, deltaFun).then(function () { - return abstractMapper.viewCleanup.apply(db); - }).then(function () { - return {ok: true}; +// so when you do e.g. $eq/$eq, we can do it entirely in the database. +// but when you do e.g. $gt/$eq, the first part can be done +// in the database, but the second part has to be done in-memory, +// because $gt has forced us to lose precision. +// so that's what this determines +function userOperatorLosesPrecision(selector, field) { + var matcher = selector[field]; + var userOperator = pouchdbSelectorCore.getKey(matcher); + + return userOperator !== '$eq'; +} + +// sort the user fields by their position in the index, +// if they're in the index +function sortFieldsByIndex(userFields, index) { + var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); + + return userFields.slice().sort(function (a, b) { + var aIdx = indexFields.indexOf(a); + var bIdx = indexFields.indexOf(b); + if (aIdx === -1) { + aIdx = Number.MAX_VALUE; + } + if (bIdx === -1) { + bIdx = Number.MAX_VALUE; + } + return pouchdbSelectorCore.compare(aIdx, bIdx); }); } -var createIndexAsCallback = callbackify(createIndex$1); -var findAsCallback = callbackify(find$1); -var explainAsCallback = callbackify(explain$1); -var getIndexesAsCallback = callbackify(getIndexes$1); -var deleteIndexAsCallback = callbackify(deleteIndex$1); +// first pass to try to find fields that will need to be sorted in-memory +function getBasicInMemoryFields(index, selector, userFields) { -var plugin = {}; -plugin.createIndex = pouchdbUtils.toPromise(function (requestDef, callback) { + userFields = sortFieldsByIndex(userFields, index); - if (typeof requestDef !== 'object') { - return callback(new Error('you must provide an index to create')); + // check if any of the user selectors lose precision + var needToFilterInMemory = false; + for (var i = 0, len = userFields.length; i < len; i++) { + var field = userFields[i]; + if (needToFilterInMemory || !checkFieldInIndex(index, field)) { + return userFields.slice(i); + } + if (i < len - 1 && userOperatorLosesPrecision(selector, field)) { + needToFilterInMemory = true; + } } + return []; +} - var createIndex$$1 = pouchdbUtils.isRemote(this) ? - createIndex : createIndexAsCallback; - createIndex$$1(this, requestDef, callback); -}); +function getInMemoryFieldsFromNe(selector) { + var fields = []; + Object.keys(selector).forEach(function (field) { + var matcher = selector[field]; + Object.keys(matcher).forEach(function (operator) { + if (operator === '$ne') { + fields.push(field); + } + }); + }); + return fields; +} -plugin.find = pouchdbUtils.toPromise(function (requestDef, callback) { +function getInMemoryFields(coreInMemoryFields, index, selector, userFields) { + var result = flatten( + // in-memory fields reported as necessary by the query planner + coreInMemoryFields, + // combine with another pass that checks for any we may have missed + getBasicInMemoryFields(index, selector, userFields), + // combine with another pass that checks for $ne's + getInMemoryFieldsFromNe(selector) + ); - if (typeof callback === 'undefined') { - callback = requestDef; - requestDef = undefined; - } + return sortFieldsByIndex(uniq(result), index); +} - if (typeof requestDef !== 'object') { - return callback(new Error('you must provide search parameters to find()')); +// check that at least one field in the user's query is represented +// in the index. order matters in the case of sorts +function checkIndexFieldsMatch(indexFields, sortOrder, fields) { + if (sortOrder) { + // array has to be a strict subarray of index array. furthermore, + // the sortOrder fields need to all be represented in the index + var sortMatches = oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields); + var selectorMatches = oneArrayIsSubArrayOfOther(fields, indexFields); + + return sortMatches && selectorMatches; } - var find$$1 = pouchdbUtils.isRemote(this) ? find : findAsCallback; - find$$1(this, requestDef, callback); -}); + // all of the user's specified fields still need to be + // on the left side of the index array, although the order + // doesn't matter + return oneSetIsSubArrayOfOther(fields, indexFields); +} -plugin.explain = pouchdbUtils.toPromise(function (requestDef, callback) { +var logicalMatchers = ['$eq', '$gt', '$gte', '$lt', '$lte']; +function isNonLogicalMatcher(matcher) { + return logicalMatchers.indexOf(matcher) === -1; +} - if (typeof callback === 'undefined') { - callback = requestDef; - requestDef = undefined; - } +// check all the index fields for usages of '$ne' +// e.g. if the user queries {foo: {$ne: 'foo'}, bar: {$eq: 'bar'}}, +// then we can neither use an index on ['foo'] nor an index on +// ['foo', 'bar'], but we can use an index on ['bar'] or ['bar', 'foo'] +function checkFieldsLogicallySound(indexFields, selector) { + var firstField = indexFields[0]; + var matcher = selector[firstField]; - if (typeof requestDef !== 'object') { - return callback(new Error('you must provide search parameters to explain()')); + if (typeof matcher === 'undefined') { + /* istanbul ignore next */ + return true; } - var find$$1 = pouchdbUtils.isRemote(this) ? explain : explainAsCallback; - find$$1(this, requestDef, callback); -}); + var hasLogicalOperator = Object.keys(matcher).some(function (matcherKey) { + return !(isNonLogicalMatcher(matcherKey)); + }); -plugin.getIndexes = pouchdbUtils.toPromise(function (callback) { + if (!hasLogicalOperator) { + return false; + } - var getIndexes$$1 = pouchdbUtils.isRemote(this) ? getIndexes : getIndexesAsCallback; - getIndexes$$1(this, callback); -}); + var isInvalidNe = Object.keys(matcher).length === 1 && + pouchdbSelectorCore.getKey(matcher) === '$ne'; -plugin.deleteIndex = pouchdbUtils.toPromise(function (indexDef, callback) { + return !isInvalidNe; +} - if (typeof indexDef !== 'object') { - return callback(new Error('you must provide an index to delete')); - } +function checkIndexMatches(index, sortOrder, fields, selector) { - var deleteIndex$$1 = pouchdbUtils.isRemote(this) ? - deleteIndex : deleteIndexAsCallback; - deleteIndex$$1(this, indexDef, callback); -}); + var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); -module.exports = plugin; + var fieldsMatch = checkIndexFieldsMatch(indexFields, sortOrder, fields); -}).call(this,require('_process')) -},{"_process":546,"pouchdb-abstract-mapreduce":504,"pouchdb-collate":521,"pouchdb-md5":537,"pouchdb-promise":531,"pouchdb-selector-core":541,"pouchdb-utils":542}],531:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],532:[function(require,module,exports){ -'use strict'; + if (!fieldsMatch) { + return false; + } -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + return checkFieldsLogicallySound(indexFields, selector); +} -var Promise = _interopDefault(require('pouchdb-promise')); -var pouchdbMd5 = require('pouchdb-md5'); -var pouchdbCollate = require('pouchdb-collate'); +// +// the algorithm is very simple: +// take all the fields the user supplies, and if those fields +// are a strict subset of the fields in some index, +// then use that index +// +// +function findMatchingIndexes(selector, userFields, sortOrder, indexes) { -function sortObjectPropertiesByKey(queryParams) { - return Object.keys(queryParams).sort(pouchdbCollate.collate).reduce(function (result, key) { - result[key] = queryParams[key]; - return result; - }, {}); + return indexes.reduce(function (res, index) { + var indexMatches = checkIndexMatches(index, sortOrder, userFields, selector); + if (indexMatches) { + res.push(index); + } + return res; + }, []); } -// Generate a unique id particular to this replication. -// Not guaranteed to align perfectly with CouchDB's rep ids. -function generateReplicationId(src, target, opts) { - var docIds = opts.doc_ids ? opts.doc_ids.sort(pouchdbCollate.collate) : ''; - var filterFun = opts.filter ? opts.filter.toString() : ''; - var queryParams = ''; - var filterViewName = ''; - var selector = ''; +// find the best index, i.e. the one that matches the most fields +// in the user's query +function findBestMatchingIndex(selector, userFields, sortOrder, indexes, useIndex) { - // possibility for checkpoints to be lost here as behaviour of - // JSON.stringify is not stable (see #6226) - /* istanbul ignore if */ - if (opts.selector) { - selector = JSON.stringify(opts.selector); - } + var matchingIndexes = findMatchingIndexes(selector, userFields, sortOrder, indexes); - if (opts.filter && opts.query_params) { - queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params)); + if (matchingIndexes.length === 0) { + if (useIndex) { + throw { + error: "no_usable_index", + message: "There is no index available for this selector." + }; + } + //return `all_docs` as a default index; + //I'm assuming that _all_docs is always first + var defaultIndex = indexes[0]; + defaultIndex.defaultUsed = true; + return defaultIndex; } - - if (opts.filter && opts.filter === '_view') { - filterViewName = opts.view.toString(); + if (matchingIndexes.length === 1 && !useIndex) { + return matchingIndexes[0]; } - return Promise.all([src.id(), target.id()]).then(function (res) { - var queryData = res[0] + res[1] + filterFun + filterViewName + - queryParams + docIds + selector; - return new Promise(function (resolve) { - pouchdbMd5.binaryMd5(queryData, resolve); - }); - }).then(function (md5sum) { - // can't use straight-up md5 alphabet, because - // the char '/' is interpreted as being for attachments, - // and + is also not url-safe - md5sum = md5sum.replace(/\//g, '.').replace(/\+/g, '_'); - return '_local/' + md5sum; - }); -} - -module.exports = generateReplicationId; + var userFieldsMap = arrayToObject(userFields); -},{"pouchdb-collate":521,"pouchdb-md5":537,"pouchdb-promise":533}],533:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],534:[function(require,module,exports){ -'use strict'; + function scoreIndex(index) { + var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); + var score = 0; + for (var i = 0, len = indexFields.length; i < len; i++) { + var indexField = indexFields[i]; + if (userFieldsMap[indexField]) { + score++; + } + } + return score; + } -Object.defineProperty(exports, '__esModule', { value: true }); + if (useIndex) { + var useIndexDdoc = '_design/' + useIndex[0]; + var useIndexName = useIndex.length === 2 ? useIndex[1] : false; + var index = matchingIndexes.find(function (index) { + if (useIndexName && index.ddoc === useIndexDdoc && useIndexName === index.name) { + return true; + } -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + if (index.ddoc === useIndexDdoc) { + /* istanbul ignore next */ + return true; + } -var vuvuzela = _interopDefault(require('vuvuzela')); + return false; + }); -function safeJsonParse(str) { - // This try/catch guards against stack overflow errors. - // JSON.parse() is faster than vuvuzela.parse() but vuvuzela - // cannot overflow. - try { - return JSON.parse(str); - } catch (e) { - /* istanbul ignore next */ - return vuvuzela.parse(str); + if (!index) { + throw { + error: "unknown_error", + message: "Could not find that index or could not use that index for the query" + }; + } + return index; } + + return max(matchingIndexes, scoreIndex); } -function safeJsonStringify(json) { - try { - return JSON.stringify(json); - } catch (e) { - /* istanbul ignore next */ - return vuvuzela.stringify(json); +function getSingleFieldQueryOptsFor(userOperator, userValue) { + switch (userOperator) { + case '$eq': + return {key: userValue}; + case '$lte': + return {endkey: userValue}; + case '$gte': + return {startkey: userValue}; + case '$lt': + return { + endkey: userValue, + inclusive_end: false + }; + case '$gt': + return { + startkey: userValue, + inclusive_start: false + }; } } -exports.safeJsonParse = safeJsonParse; -exports.safeJsonStringify = safeJsonStringify; +function getSingleFieldCoreQueryPlan(selector, index) { + var field = pouchdbSelectorCore.getKey(index.def.fields[0]); + //ignoring this because the test to exercise the branch is skipped at the moment + /* istanbul ignore next */ + var matcher = selector[field] || {}; + var inMemoryFields = []; -},{"vuvuzela":611}],535:[function(require,module,exports){ -'use strict'; + var userOperators = Object.keys(matcher); -Object.defineProperty(exports, '__esModule', { value: true }); + var combinedOpts; -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + userOperators.forEach(function (userOperator) { -var pouchdbCollections = require('pouchdb-collections'); -var argsarray = _interopDefault(require('argsarray')); -var pouchdbUtils = require('pouchdb-utils'); -var inherits = _interopDefault(require('inherits')); + if (isNonLogicalMatcher(userOperator)) { + inMemoryFields.push(field); + return; + } -function QueryParseError(message) { - this.status = 400; - this.name = 'query_parse_error'; - this.message = message; - this.error = true; - try { - Error.captureStackTrace(this, QueryParseError); - } catch (e) {} -} + var userValue = matcher[userOperator]; -inherits(QueryParseError, Error); + var newQueryOpts = getSingleFieldQueryOptsFor(userOperator, userValue); -function NotFoundError(message) { - this.status = 404; - this.name = 'not_found'; - this.message = message; - this.error = true; - try { - Error.captureStackTrace(this, NotFoundError); - } catch (e) {} -} + if (combinedOpts) { + combinedOpts = mergeObjects([combinedOpts, newQueryOpts]); + } else { + combinedOpts = newQueryOpts; + } + }); -inherits(NotFoundError, Error); + return { + queryOpts: combinedOpts, + inMemoryFields: inMemoryFields + }; +} -function BuiltInError(message) { - this.status = 500; - this.name = 'invalid_value'; - this.message = message; - this.error = true; - try { - Error.captureStackTrace(this, BuiltInError); - } catch (e) {} +function getMultiFieldCoreQueryPlan(userOperator, userValue) { + switch (userOperator) { + case '$eq': + return { + startkey: userValue, + endkey: userValue + }; + case '$lte': + return { + endkey: userValue + }; + case '$gte': + return { + startkey: userValue + }; + case '$lt': + return { + endkey: userValue, + inclusive_end: false + }; + case '$gt': + return { + startkey: userValue, + inclusive_start: false + }; + } } -inherits(BuiltInError, Error); +function getMultiFieldQueryOpts(selector, index) { -function promisedCallback(promise, callback) { - if (callback) { - promise.then(function (res) { - pouchdbUtils.nextTick(function () { - callback(null, res); - }); - }, function (reason) { - pouchdbUtils.nextTick(function () { - callback(reason); - }); - }); - } - return promise; -} + var indexFields = index.def.fields.map(pouchdbSelectorCore.getKey); -function callbackify(fun) { - return argsarray(function (args) { - var cb = args.pop(); - var promise = fun.apply(this, args); - if (typeof cb === 'function') { - promisedCallback(promise, cb); + var inMemoryFields = []; + var startkey = []; + var endkey = []; + var inclusiveStart; + var inclusiveEnd; + + + function finish(i) { + + if (inclusiveStart !== false) { + startkey.push(COLLATE_LO); } - return promise; - }); -} + if (inclusiveEnd !== false) { + endkey.push(COLLATE_HI); + } + // keep track of the fields where we lost specificity, + // and therefore need to filter in-memory + inMemoryFields = indexFields.slice(i); + } -// Promise finally util similar to Q.finally -function fin(promise, finalPromiseFactory) { - return promise.then(function (res) { - return finalPromiseFactory().then(function () { - return res; - }); - }, function (reason) { - return finalPromiseFactory().then(function () { - throw reason; - }); - }); -} + for (var i = 0, len = indexFields.length; i < len; i++) { + var indexField = indexFields[i]; -function sequentialize(queue, promiseFactory) { - return function () { - var args = arguments; - var that = this; - return queue.add(function () { - return promiseFactory.apply(that, args); - }); - }; -} + var matcher = selector[indexField]; -// uniq an array of strings, order not guaranteed -// similar to underscore/lodash _.uniq -function uniq(arr) { - var theSet = new pouchdbCollections.Set(arr); - var result = new Array(theSet.size); - var index = -1; - theSet.forEach(function (value) { - result[++index] = value; - }); - return result; -} + if (!matcher || !Object.keys(matcher).length) { // fewer fields in user query than in index + finish(i); + break; + } else if (i > 0) { + if (Object.keys(matcher).some(isNonLogicalMatcher)) { // non-logical are ignored + finish(i); + break; + } + var usingGtlt = ( + '$gt' in matcher || '$gte' in matcher || + '$lt' in matcher || '$lte' in matcher); + var previousKeys = Object.keys(selector[indexFields[i - 1]]); + var previousWasEq = arrayEquals(previousKeys, ['$eq']); + var previousWasSame = arrayEquals(previousKeys, Object.keys(matcher)); + var gtltLostSpecificity = usingGtlt && !previousWasEq && !previousWasSame; + if (gtltLostSpecificity) { + finish(i); + break; + } + } -function mapToKeysArray(map) { - var result = new Array(map.size); - var index = -1; - map.forEach(function (value, key) { - result[++index] = key; - }); - return result; -} + var userOperators = Object.keys(matcher); -exports.uniq = uniq; -exports.sequentialize = sequentialize; -exports.fin = fin; -exports.callbackify = callbackify; -exports.promisedCallback = promisedCallback; -exports.mapToKeysArray = mapToKeysArray; -exports.QueryParseError = QueryParseError; -exports.NotFoundError = NotFoundError; -exports.BuiltInError = BuiltInError; + var combinedOpts = null; -},{"argsarray":39,"inherits":495,"pouchdb-collections":536,"pouchdb-utils":542}],536:[function(require,module,exports){ -arguments[4][505][0].apply(exports,arguments) -},{"dup":505}],537:[function(require,module,exports){ -(function (global){ -'use strict'; + for (var j = 0; j < userOperators.length; j++) { + var userOperator = userOperators[j]; + var userValue = matcher[userOperator]; -Object.defineProperty(exports, '__esModule', { value: true }); + var newOpts = getMultiFieldCoreQueryPlan(userOperator, userValue); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + if (combinedOpts) { + combinedOpts = mergeObjects([combinedOpts, newOpts]); + } else { + combinedOpts = newOpts; + } + } -var pouchdbBinaryUtils = require('pouchdb-binary-utils'); -var Md5 = _interopDefault(require('spark-md5')); + startkey.push('startkey' in combinedOpts ? combinedOpts.startkey : COLLATE_LO); + endkey.push('endkey' in combinedOpts ? combinedOpts.endkey : COLLATE_HI); + if ('inclusive_start' in combinedOpts) { + inclusiveStart = combinedOpts.inclusive_start; + } + if ('inclusive_end' in combinedOpts) { + inclusiveEnd = combinedOpts.inclusive_end; + } + } -var setImmediateShim = global.setImmediate || global.setTimeout; -var MD5_CHUNK_SIZE = 32768; + var res = { + startkey: startkey, + endkey: endkey + }; -function rawToBase64(raw) { - return pouchdbBinaryUtils.btoa(raw); + if (typeof inclusiveStart !== 'undefined') { + res.inclusive_start = inclusiveStart; + } + if (typeof inclusiveEnd !== 'undefined') { + res.inclusive_end = inclusiveEnd; + } + + return { + queryOpts: res, + inMemoryFields: inMemoryFields + }; } -function sliceBlob(blob, start, end) { - if (blob.webkitSlice) { - return blob.webkitSlice(start, end); - } - return blob.slice(start, end); +function getDefaultQueryPlan(selector) { + //using default index, so all fields need to be done in memory + return { + queryOpts: {startkey: null}, + inMemoryFields: [Object.keys(selector)] + }; } -function appendBlob(buffer, blob, start, end, callback) { - if (start > 0 || end < blob.size) { - // only slice blob if we really need to - blob = sliceBlob(blob, start, end); +function getCoreQueryPlan(selector, index) { + if (index.defaultUsed) { + return getDefaultQueryPlan(selector, index); } - pouchdbBinaryUtils.readAsArrayBuffer(blob, function (arrayBuffer) { - buffer.append(arrayBuffer); - callback(); - }); -} -function appendString(buffer, string, start, end, callback) { - if (start > 0 || end < string.length) { - // only create a substring if we really need to - string = string.substring(start, end); + if (index.def.fields.length === 1) { + // one field in index, so the value was indexed as a singleton + return getSingleFieldCoreQueryPlan(selector, index); } - buffer.appendBinary(string); - callback(); + // else index has multiple fields, so the value was indexed as an array + return getMultiFieldQueryOpts(selector, index); } -function binaryMd5(data, callback) { - var inputIsString = typeof data === 'string'; - var len = inputIsString ? data.length : data.size; - var chunkSize = Math.min(MD5_CHUNK_SIZE, len); - var chunks = Math.ceil(len / chunkSize); - var currentChunk = 0; - var buffer = inputIsString ? new Md5() : new Md5.ArrayBuffer(); +function planQuery(request, indexes) { - var append = inputIsString ? appendString : appendBlob; + var selector = request.selector; + var sort = request.sort; - function next() { - setImmediateShim(loadNextChunk); - } + var userFieldsRes = getUserFields(selector, sort); - function done() { - var raw = buffer.end(true); - var base64 = rawToBase64(raw); - callback(base64); - buffer.destroy(); - } + var userFields = userFieldsRes.fields; + var sortOrder = userFieldsRes.sortOrder; + var index = findBestMatchingIndex(selector, userFields, sortOrder, indexes, request.use_index); - function loadNextChunk() { - var start = currentChunk * chunkSize; - var end = start + chunkSize; - currentChunk++; - if (currentChunk < chunks) { - append(buffer, data, start, end, next); - } else { - append(buffer, data, start, end, done); - } - } - loadNextChunk(); -} + var coreQueryPlan = getCoreQueryPlan(selector, index); + var queryOpts = coreQueryPlan.queryOpts; + var coreInMemoryFields = coreQueryPlan.inMemoryFields; -function stringMd5(string) { - return Md5.hash(string); + var inMemoryFields = getInMemoryFields(coreInMemoryFields, index, selector, userFields); + + var res = { + queryOpts: queryOpts, + index: index, + inMemoryFields: inMemoryFields + }; + return res; } -exports.binaryMd5 = binaryMd5; -exports.stringMd5 = stringMd5; +function indexToSignature(index) { + // remove '_design/' + return index.ddoc.substring(8) + '/' + index.name; +} -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"pouchdb-binary-utils":517,"spark-md5":599}],538:[function(require,module,exports){ -'use strict'; +function doAllDocs(db, originalOpts) { + var opts = pouchdbUtils.clone(originalOpts); -Object.defineProperty(exports, '__esModule', { value: true }); + // CouchDB responds in weird ways when you provide a non-string to _id; + // we mimic the behavior for consistency. See issue66 tests for details. -// We fetch all leafs of the revision tree, and sort them based on tree length -// and whether they were deleted, undeleted documents with the longest revision -// tree (most edits) win -// The final sort algorithm is slightly documented in a sidebar here: -// http://guide.couchdb.org/draft/conflicts.html -function winningRev(metadata) { - var winningId; - var winningPos; - var winningDeleted; - var toVisit = metadata.rev_tree.slice(); - var node; - while ((node = toVisit.pop())) { - var tree = node.ids; - var branches = tree[2]; - var pos = node.pos; - if (branches.length) { // non-leaf - for (var i = 0, len = branches.length; i < len; i++) { - toVisit.push({pos: pos + 1, ids: branches[i]}); - } - continue; + if (opts.descending) { + if ('endkey' in opts && typeof opts.endkey !== 'string') { + opts.endkey = ''; } - var deleted = !!tree[1].deleted; - var id = tree[0]; - // sort by deleted, then pos, then id - if (!winningId || (winningDeleted !== deleted ? winningDeleted : - winningPos !== pos ? winningPos < pos : winningId < id)) { - winningId = id; - winningPos = pos; - winningDeleted = deleted; + if ('startkey' in opts && typeof opts.startkey !== 'string') { + opts.limit = 0; } + } else { + if ('startkey' in opts && typeof opts.startkey !== 'string') { + opts.startkey = ''; + } + if ('endkey' in opts && typeof opts.endkey !== 'string') { + opts.limit = 0; + } + } + if ('key' in opts && typeof opts.key !== 'string') { + opts.limit = 0; } - return winningPos + '-' + winningId; + return db.allDocs(opts) + .then(function (res) { + // filter out any design docs that _all_docs might return + res.rows = res.rows.filter(function (row) { + return !/^_design\//.test(row.id); + }); + return res; + }); } -// Pretty much all below can be combined into a higher order function to -// traverse revisions -// The return value from the callback will be passed as context to all -// children of that node -function traverseRevTree(revs, callback) { - var toVisit = revs.slice(); - - var node; - while ((node = toVisit.pop())) { - var pos = node.pos; - var tree = node.ids; - var branches = tree[2]; - var newCtx = - callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]); - for (var i = 0, len = branches.length; i < len; i++) { - toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx}); - } +function find$1(db, requestDef, explain) { + if (requestDef.selector) { + requestDef.selector = pouchdbSelectorCore.massageSelector(requestDef.selector); } -} -function sortByPos(a, b) { - return a.pos - b.pos; -} - -function collectLeaves(revs) { - var leaves = []; - traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) { - if (isLeaf) { - leaves.push({rev: pos + "-" + id, pos: pos, opts: opts}); - } - }); - leaves.sort(sortByPos).reverse(); - for (var i = 0, len = leaves.length; i < len; i++) { - delete leaves[i].pos; + if (requestDef.sort) { + requestDef.sort = massageSort(requestDef.sort); } - return leaves; -} -// returns revs of all conflicts that is leaves such that -// 1. are not deleted and -// 2. are different than winning revision -function collectConflicts(metadata) { - var win = winningRev(metadata); - var leaves = collectLeaves(metadata.rev_tree); - var conflicts = []; - for (var i = 0, len = leaves.length; i < len; i++) { - var leaf = leaves[i]; - if (leaf.rev !== win && !leaf.opts.deleted) { - conflicts.push(leaf.rev); - } + if (requestDef.use_index) { + requestDef.use_index = massageUseIndex(requestDef.use_index); } - return conflicts; -} -// compact a tree by marking its non-leafs as missing, -// and return a list of revs to delete -function compactTree(metadata) { - var revs = []; - traverseRevTree(metadata.rev_tree, function (isLeaf, pos, - revHash, ctx, opts) { - if (opts.status === 'available' && !isLeaf) { - revs.push(pos + '-' + revHash); - opts.status = 'missing'; - } - }); - return revs; -} + validateFindRequest(requestDef); -// build up a list of all the paths to the leafs in this revision tree -function rootToLeaf(revs) { - var paths = []; - var toVisit = revs.slice(); - var node; - while ((node = toVisit.pop())) { - var pos = node.pos; - var tree = node.ids; - var id = tree[0]; - var opts = tree[1]; - var branches = tree[2]; - var isLeaf = branches.length === 0; + return getIndexes$1(db).then(function (getIndexesRes) { - var history = node.history ? node.history.slice() : []; - history.push({id: id, opts: opts}); - if (isLeaf) { - paths.push({pos: (pos + 1 - history.length), ids: history}); - } - for (var i = 0, len = branches.length; i < len; i++) { - toVisit.push({pos: pos + 1, ids: branches[i], history: history}); - } - } - return paths.reverse(); -} + db.constructor.emit('debug', ['find', 'planning query', requestDef]); + var queryPlan = planQuery(requestDef, getIndexesRes.indexes); + db.constructor.emit('debug', ['find', 'query plan', queryPlan]); -// for a better overview of what this is doing, read: -// https://github.com/apache/couchdb-couch/blob/master/src/couch_key_tree.erl -// -// But for a quick intro, CouchDB uses a revision tree to store a documents -// history, A -> B -> C, when a document has conflicts, that is a branch in the -// tree, A -> (B1 | B2 -> C), We store these as a nested array in the format -// -// KeyTree = [Path ... ] -// Path = {pos: position_from_root, ids: Tree} -// Tree = [Key, Opts, [Tree, ...]], in particular single node: [Key, []] + var indexToUse = queryPlan.index; -function sortByPos$1(a, b) { - return a.pos - b.pos; -} + validateSort(requestDef, indexToUse); -// classic binary search -function binarySearch(arr, item, comparator) { - var low = 0; - var high = arr.length; - var mid; - while (low < high) { - mid = (low + high) >>> 1; - if (comparator(arr[mid], item) < 0) { - low = mid + 1; - } else { - high = mid; + var opts = pouchdbUtils.assign({ + include_docs: true, + reduce: false + }, queryPlan.queryOpts); + + if ('startkey' in opts && 'endkey' in opts && + pouchdbCollate.collate(opts.startkey, opts.endkey) > 0) { + // can't possibly return any results, startkey > endkey + /* istanbul ignore next */ + return {docs: []}; } - } - return low; -} -// assuming the arr is sorted, insert the item in the proper place -function insertSorted(arr, item, comparator) { - var idx = binarySearch(arr, item, comparator); - arr.splice(idx, 0, item); -} + var isDescending = requestDef.sort && + typeof requestDef.sort[0] !== 'string' && + pouchdbSelectorCore.getValue(requestDef.sort[0]) === 'desc'; -// Turn a path as a flat array into a tree with a single branch. -// If any should be stemmed from the beginning of the array, that's passed -// in as the second argument -function pathToTree(path, numStemmed) { - var root; - var leaf; - for (var i = numStemmed, len = path.length; i < len; i++) { - var node = path[i]; - var currentLeaf = [node.id, node.opts, []]; - if (leaf) { - leaf[2].push(currentLeaf); - leaf = currentLeaf; - } else { - root = leaf = currentLeaf; + if (isDescending) { + // either all descending or all ascending + opts.descending = true; + opts = reverseOptions(opts); } - } - return root; -} - -// compare the IDs of two trees -function compareTree(a, b) { - return a[0] < b[0] ? -1 : 1; -} -// Merge two trees together -// The roots of tree1 and tree2 must be the same revision -function mergeTree(in_tree1, in_tree2) { - var queue = [{tree1: in_tree1, tree2: in_tree2}]; - var conflicts = false; - while (queue.length > 0) { - var item = queue.pop(); - var tree1 = item.tree1; - var tree2 = item.tree2; - - if (tree1[1].status || tree2[1].status) { - tree1[1].status = - (tree1[1].status === 'available' || - tree2[1].status === 'available') ? 'available' : 'missing'; + if (!queryPlan.inMemoryFields.length) { + // no in-memory filtering necessary, so we can let the + // database do the limit/skip for us + if ('limit' in requestDef) { + opts.limit = requestDef.limit; + } + if ('skip' in requestDef) { + opts.skip = requestDef.skip; + } } - for (var i = 0; i < tree2[2].length; i++) { - if (!tree1[2][0]) { - conflicts = 'new_leaf'; - tree1[2][0] = tree2[2][i]; - continue; - } + if (explain) { + return Promise.resolve(queryPlan, opts); + } - var merged = false; - for (var j = 0; j < tree1[2].length; j++) { - if (tree1[2][j][0] === tree2[2][i][0]) { - queue.push({tree1: tree1[2][j], tree2: tree2[2][i]}); - merged = true; - } + return Promise.resolve().then(function () { + if (indexToUse.name === '_all_docs') { + return doAllDocs(db, opts); + } else { + var signature = indexToSignature(indexToUse); + return abstractMapper.query.call(db, signature, opts); } - if (!merged) { - conflicts = 'new_branch'; - insertSorted(tree1[2], tree2[2][i], compareTree); + }).then(function (res) { + if (opts.inclusive_start === false) { + // may have to manually filter the first one, + // since couchdb has no true inclusive_start option + res.rows = filterInclusiveStart(res.rows, opts.startkey, indexToUse); } - } - } - return {conflicts: conflicts, tree: in_tree1}; -} - -function doMerge(tree, path, dontExpand) { - var restree = []; - var conflicts = false; - var merged = false; - var res; - if (!tree.length) { - return {tree: [path], conflicts: 'new_leaf'}; - } + if (queryPlan.inMemoryFields.length) { + // need to filter some stuff in-memory + res.rows = pouchdbSelectorCore.filterInMemoryFields(res.rows, requestDef, queryPlan.inMemoryFields); + } - for (var i = 0, len = tree.length; i < len; i++) { - var branch = tree[i]; - if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) { - // Paths start at the same position and have the same root, so they need - // merged - res = mergeTree(branch.ids, path.ids); - restree.push({pos: branch.pos, ids: res.tree}); - conflicts = conflicts || res.conflicts; - merged = true; - } else if (dontExpand !== true) { - // The paths start at a different position, take the earliest path and - // traverse up until it as at the same point from root as the path we - // want to merge. If the keys match we return the longer path with the - // other merged After stemming we dont want to expand the trees + var resp = { + docs: res.rows.map(function (row) { + var doc = row.doc; + if (requestDef.fields) { + return pick(doc, requestDef.fields); + } + return doc; + }) + }; - var t1 = branch.pos < path.pos ? branch : path; - var t2 = branch.pos < path.pos ? path : branch; - var diff = t2.pos - t1.pos; + if (indexToUse.defaultUsed) { + resp.warning = 'no matching index found, create an index to optimize query time'; + } - var candidateParents = []; + return resp; + }); + }); +} - var trees = []; - trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null}); - while (trees.length > 0) { - var item = trees.pop(); - if (item.diff === 0) { - if (item.ids[0] === t2.ids[0]) { - candidateParents.push(item); - } - continue; - } - var elements = item.ids[2]; - for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) { - trees.push({ - ids: elements[j], - diff: item.diff - 1, - parent: item.ids, - parentIdx: j - }); - } - } +function explain$1(db, requestDef) { + return find$1(db, requestDef, true) + .then(function (queryPlan) { + return { + dbname: db.name, + index: queryPlan.index, + selector: requestDef.selector, + range: { + start_key: queryPlan.queryOpts.startkey, + end_key: queryPlan.queryOpts.endkey, + }, + opts: { + use_index: requestDef.use_index || [], + bookmark: "nil", //hardcoded to match CouchDB since its not supported, + limit: requestDef.limit, + skip: requestDef.skip, + sort: requestDef.sort || {}, + fields: requestDef.fields, + conflicts: false, //hardcoded to match CouchDB since its not supported, + r: [49], // hardcoded to match CouchDB since its not support + }, + limit: requestDef.limit, + skip: requestDef.skip || 0, + fields: requestDef.fields, + }; + }); +} - var el = candidateParents[0]; +function deleteIndex$1(db, index) { - if (!el) { - restree.push(branch); - } else { - res = mergeTree(el.ids, t2.ids); - el.parent[2][el.parentIdx] = res.tree; - restree.push({pos: t1.pos, ids: t1.ids}); - conflicts = conflicts || res.conflicts; - merged = true; - } - } else { - restree.push(branch); - } + if (!index.ddoc) { + throw new Error('you must supply an index.ddoc when deleting'); } - // We didnt find - if (!merged) { - restree.push(path); + if (!index.name) { + throw new Error('you must supply an index.name when deleting'); } - restree.sort(sortByPos$1); - - return { - tree: restree, - conflicts: conflicts || 'internal_node' - }; -} + var docId = index.ddoc; + var viewName = index.name; -// To ensure we dont grow the revision tree infinitely, we stem old revisions -function stem(tree, depth) { - // First we break out the tree into a complete list of root to leaf paths - var paths = rootToLeaf(tree); - var stemmedRevs; + function deltaFun(doc) { + if (Object.keys(doc.views).length === 1 && doc.views[viewName]) { + // only one view in this ddoc, delete the whole ddoc + return {_id: docId, _deleted: true}; + } + // more than one view here, just remove the view + delete doc.views[viewName]; + return doc; + } - var result; - for (var i = 0, len = paths.length; i < len; i++) { - // Then for each path, we cut off the start of the path based on the - // `depth` to stem to, and generate a new set of flat trees - var path = paths[i]; - var stemmed = path.ids; - var node; - if (stemmed.length > depth) { - // only do the stemming work if we actually need to stem - if (!stemmedRevs) { - stemmedRevs = {}; // avoid allocating this object unnecessarily - } - var numStemmed = stemmed.length - depth; - node = { - pos: path.pos + numStemmed, - ids: pathToTree(stemmed, numStemmed) - }; + return pouchdbUtils.upsert(db, docId, deltaFun).then(function () { + return abstractMapper.viewCleanup.apply(db); + }).then(function () { + return {ok: true}; + }); +} - for (var s = 0; s < numStemmed; s++) { - var rev = (path.pos + s) + '-' + stemmed[s].id; - stemmedRevs[rev] = true; - } - } else { // no need to actually stem - node = { - pos: path.pos, - ids: pathToTree(stemmed, 0) - }; - } +var createIndexAsCallback = callbackify(createIndex$1); +var findAsCallback = callbackify(find$1); +var explainAsCallback = callbackify(explain$1); +var getIndexesAsCallback = callbackify(getIndexes$1); +var deleteIndexAsCallback = callbackify(deleteIndex$1); - // Then we remerge all those flat trees together, ensuring that we dont - // connect trees that would go beyond the depth limit - if (result) { - result = doMerge(result, node, true).tree; - } else { - result = [node]; - } - } +var plugin = {}; +plugin.createIndex = pouchdbUtils.toPromise(function (requestDef, callback) { - // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed - if (stemmedRevs) { - traverseRevTree(result, function (isLeaf, pos, revHash) { - // some revisions may have been removed in a branch but not in another - delete stemmedRevs[pos + '-' + revHash]; - }); + if (typeof requestDef !== 'object') { + return callback(new Error('you must provide an index to create')); } - return { - tree: result, - revs: stemmedRevs ? Object.keys(stemmedRevs) : [] - }; -} + var createIndex$$1 = pouchdbUtils.isRemote(this) ? + createIndex : createIndexAsCallback; + createIndex$$1(this, requestDef, callback); +}); -function merge(tree, path, depth) { - var newTree = doMerge(tree, path); - var stemmed = stem(newTree.tree, depth); - return { - tree: stemmed.tree, - stemmedRevs: stemmed.revs, - conflicts: newTree.conflicts - }; -} +plugin.find = pouchdbUtils.toPromise(function (requestDef, callback) { -// return true if a rev exists in the rev tree, false otherwise -function revExists(revs, rev) { - var toVisit = revs.slice(); - var splitRev = rev.split('-'); - var targetPos = parseInt(splitRev[0], 10); - var targetId = splitRev[1]; + if (typeof callback === 'undefined') { + callback = requestDef; + requestDef = undefined; + } - var node; - while ((node = toVisit.pop())) { - if (node.pos === targetPos && node.ids[0] === targetId) { - return true; - } - var branches = node.ids[2]; - for (var i = 0, len = branches.length; i < len; i++) { - toVisit.push({pos: node.pos + 1, ids: branches[i]}); - } + if (typeof requestDef !== 'object') { + return callback(new Error('you must provide search parameters to find()')); } - return false; -} -function getTrees(node) { - return node.ids; -} + var find$$1 = pouchdbUtils.isRemote(this) ? find : findAsCallback; + find$$1(this, requestDef, callback); +}); -// check if a specific revision of a doc has been deleted -// - metadata: the metadata object from the doc store -// - rev: (optional) the revision to check. defaults to winning revision -function isDeleted(metadata, rev) { - if (!rev) { - rev = winningRev(metadata); - } - var id = rev.substring(rev.indexOf('-') + 1); - var toVisit = metadata.rev_tree.map(getTrees); +plugin.explain = pouchdbUtils.toPromise(function (requestDef, callback) { - var tree; - while ((tree = toVisit.pop())) { - if (tree[0] === id) { - return !!tree[1].deleted; - } - toVisit = toVisit.concat(tree[2]); + if (typeof callback === 'undefined') { + callback = requestDef; + requestDef = undefined; } -} -function isLocalId(id) { - return (/^_local/).test(id); -} + if (typeof requestDef !== 'object') { + return callback(new Error('you must provide search parameters to explain()')); + } -// returns the current leaf node for a given revision -function latest(rev, metadata) { - var toVisit = metadata.rev_tree.slice(); - var node; - while ((node = toVisit.pop())) { - var pos = node.pos; - var tree = node.ids; - var id = tree[0]; - var opts = tree[1]; - var branches = tree[2]; - var isLeaf = branches.length === 0; + var find$$1 = pouchdbUtils.isRemote(this) ? explain : explainAsCallback; + find$$1(this, requestDef, callback); +}); - var history = node.history ? node.history.slice() : []; - history.push({id: id, pos: pos, opts: opts}); +plugin.getIndexes = pouchdbUtils.toPromise(function (callback) { - if (isLeaf) { - for (var i = 0, len = history.length; i < len; i++) { - var historyNode = history[i]; - var historyRev = historyNode.pos + '-' + historyNode.id; + var getIndexes$$1 = pouchdbUtils.isRemote(this) ? getIndexes : getIndexesAsCallback; + getIndexes$$1(this, callback); +}); - if (historyRev === rev) { - // return the rev of this leaf - return pos + '-' + id; - } - } - } +plugin.deleteIndex = pouchdbUtils.toPromise(function (indexDef, callback) { - for (var j = 0, l = branches.length; j < l; j++) { - toVisit.push({pos: pos + 1, ids: branches[j], history: history}); - } + if (typeof indexDef !== 'object') { + return callback(new Error('you must provide an index to delete')); } - /* istanbul ignore next */ - throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev); -} + var deleteIndex$$1 = pouchdbUtils.isRemote(this) ? + deleteIndex : deleteIndexAsCallback; + deleteIndex$$1(this, indexDef, callback); +}); -exports.collectConflicts = collectConflicts; -exports.collectLeaves = collectLeaves; -exports.compactTree = compactTree; -exports.isDeleted = isDeleted; -exports.isLocalId = isLocalId; -exports.merge = merge; -exports.revExists = revExists; -exports.rootToLeaf = rootToLeaf; -exports.traverseRevTree = traverseRevTree; -exports.winningRev = winningRev; -exports.latest = latest; +module.exports = plugin; -},{}],539:[function(require,module,exports){ +}).call(this,require('_process')) +},{"_process":594,"pouchdb-abstract-mapreduce":552,"pouchdb-collate":554,"pouchdb-md5":558,"pouchdb-promise":559,"pouchdb-selector-core":582,"pouchdb-utils":560}],551:[function(require,module,exports){ +arguments[4][501][0].apply(exports,arguments) +},{"dup":501}],552:[function(require,module,exports){ 'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Promise = _interopDefault(require('pouchdb-promise')); var pouchdbUtils = require('pouchdb-utils'); -var Checkpointer = _interopDefault(require('pouchdb-checkpointer')); -var generateReplicationId = _interopDefault(require('pouchdb-generate-replication-id')); -var pouchdbErrors = require('pouchdb-errors'); -var events = require('events'); -var inherits = _interopDefault(require('inherits')); +var pouchdbMd5 = require('pouchdb-md5'); +var pouchdbCollections = require('pouchdb-collections'); +var pouchdbBinaryUtils = require('pouchdb-binary-utils'); +var pouchdbCollate = require('pouchdb-collate'); +var pouchdbMapreduceUtils = require('pouchdb-mapreduce-utils'); -function isGenOne(rev) { - return /^1-/.test(rev); -} +/* + * Simple task queue to sequentialize actions. Assumes + * callbacks will eventually fire (once). + */ -function fileHasChanged(localDoc, remoteDoc, filename) { - return !localDoc._attachments || - !localDoc._attachments[filename] || - localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest; -} -function getDocAttachments(db, doc) { - var filenames = Object.keys(doc._attachments); - return Promise.all(filenames.map(function (filename) { - return db.getAttachment(doc._id, filename, {rev: doc._rev}); - })); +function TaskQueue() { + this.promise = new Promise(function (fulfill) {fulfill(); }); } +TaskQueue.prototype.add = function (promiseFactory) { + this.promise = this.promise.catch(function () { + // just recover + }).then(function () { + return promiseFactory(); + }); + return this.promise; +}; +TaskQueue.prototype.finish = function () { + return this.promise; +}; -function getDocAttachmentsFromTargetOrSource(target, src, doc) { - var doCheckForLocalAttachments = pouchdbUtils.isRemote(src) && !pouchdbUtils.isRemote(target); - var filenames = Object.keys(doc._attachments); - - if (!doCheckForLocalAttachments) { - return getDocAttachments(src, doc); +function stringify(input) { + if (!input) { + return 'undefined'; // backwards compat for empty reduce + } + // for backwards compat with mapreduce, functions/strings are stringified + // as-is. everything else is JSON-stringified. + switch (typeof input) { + case 'function': + // e.g. a mapreduce map + return input.toString(); + case 'string': + // e.g. a mapreduce built-in _reduce function + return input.toString(); + default: + // e.g. a JSON object in the case of mango queries + return JSON.stringify(input); } - - return target.get(doc._id).then(function (localDoc) { - return Promise.all(filenames.map(function (filename) { - if (fileHasChanged(localDoc, doc, filename)) { - return src.getAttachment(doc._id, filename); - } - - return target.getAttachment(localDoc._id, filename); - })); - }).catch(function (error) { - /* istanbul ignore if */ - if (error.status !== 404) { - throw error; - } - - return getDocAttachments(src, doc); - }); } -function createBulkGetOpts(diffs) { - var requests = []; - Object.keys(diffs).forEach(function (id) { - var missingRevs = diffs[id].missing; - missingRevs.forEach(function (missingRev) { - requests.push({ - id: id, - rev: missingRev - }); - }); - }); - - return { - docs: requests, - revs: true, - latest: true - }; +/* create a string signature for a view so we can cache it and uniq it */ +function createViewSignature(mapFun, reduceFun) { + // the "undefined" part is for backwards compatibility + return stringify(mapFun) + stringify(reduceFun) + 'undefined'; } -// -// Fetch all the documents from the src as described in the "diffs", -// which is a mapping of docs IDs to revisions. If the state ever -// changes to "cancelled", then the returned promise will be rejected. -// Else it will be resolved with a list of fetched documents. -// -function getDocs(src, target, diffs, state) { - diffs = pouchdbUtils.clone(diffs); // we do not need to modify this - - var resultDocs = [], - ok = true; - - function getAllDocs() { - - var bulkGetOpts = createBulkGetOpts(diffs); +function createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) { + var viewSignature = createViewSignature(mapFun, reduceFun); - if (!bulkGetOpts.docs.length) { // optimization: skip empty requests - return; + var cachedViews; + if (!temporary) { + // cache this to ensure we don't try to update the same view twice + cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {}; + if (cachedViews[viewSignature]) { + return cachedViews[viewSignature]; } + } - return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) { - /* istanbul ignore if */ - if (state.cancelled) { - throw new Error('cancelled'); - } - return Promise.all(bulkGetResponse.results.map(function (bulkGetInfo) { - return Promise.all(bulkGetInfo.docs.map(function (doc) { - var remoteDoc = doc.ok; + var promiseForView = sourceDB.info().then(function (info) { - if (doc.error) { - // when AUTO_COMPACTION is set, docs can be returned which look - // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"} - ok = false; - } + var depDbName = info.db_name + '-mrview-' + + (temporary ? 'temp' : pouchdbMd5.stringMd5(viewSignature)); - if (!remoteDoc || !remoteDoc._attachments) { - return remoteDoc; + // save the view name in the source db so it can be cleaned up if necessary + // (e.g. when the _design doc is deleted, remove all associated view data) + function diffFunction(doc) { + doc.views = doc.views || {}; + var fullViewName = viewName; + if (fullViewName.indexOf('/') === -1) { + fullViewName = viewName + '/' + viewName; + } + var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {}; + /* istanbul ignore if */ + if (depDbs[depDbName]) { + return; // no update necessary + } + depDbs[depDbName] = true; + return doc; + } + return pouchdbUtils.upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () { + return sourceDB.registerDependentDatabase(depDbName).then(function (res) { + var db = res.db; + db.auto_compaction = true; + var view = { + name: depDbName, + db: db, + sourceDB: sourceDB, + adapter: sourceDB.adapter, + mapFun: mapFun, + reduceFun: reduceFun + }; + return view.db.get('_local/lastSeq').catch(function (err) { + /* istanbul ignore if */ + if (err.status !== 404) { + throw err; + } + }).then(function (lastSeqDoc) { + view.seq = lastSeqDoc ? lastSeqDoc.seq : 0; + if (cachedViews) { + view.db.once('destroyed', function () { + delete cachedViews[viewSignature]; + }); } + return view; + }); + }); + }); + }); - return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc) - .then(function (attachments) { - var filenames = Object.keys(remoteDoc._attachments); - attachments - .forEach(function (attachment, i) { - var att = remoteDoc._attachments[filenames[i]]; - delete att.stub; - delete att.length; - att.data = attachment; - }); + if (cachedViews) { + cachedViews[viewSignature] = promiseForView; + } + return promiseForView; +} - return remoteDoc; - }); - })); - })) +var persistentQueues = {}; +var tempViewQueue = new TaskQueue(); +var CHANGES_BATCH_SIZE = 50; - .then(function (results) { - resultDocs = resultDocs.concat(pouchdbUtils.flatten(results).filter(Boolean)); +function parseViewName(name) { + // can be either 'ddocname/viewname' or just 'viewname' + // (where the ddoc name is the same) + return name.indexOf('/') === -1 ? [name, name] : name.split('/'); +} + +function isGenOne(changes) { + // only return true if the current change is 1- + // and there are no other leafs + return changes.length === 1 && /^1-/.test(changes[0].rev); +} + +function emitError(db, e) { + try { + db.emit('error', e); + } catch (err) { + pouchdbUtils.guardedConsole('error', + 'The user\'s map/reduce function threw an uncaught error.\n' + + 'You can debug this error by doing:\n' + + 'myDatabase.on(\'error\', function (err) { debugger; });\n' + + 'Please double-check your map/reduce function.'); + pouchdbUtils.guardedConsole('error', e); + } +} + +/** + * Returns an "abstract" mapreduce object of the form: + * + * { + * query: queryFun, + * viewCleanup: viewCleanupFun + * } + * + * Arguments are: + * + * localDoc: string + * This is for the local doc that gets saved in order to track the + * "dependent" DBs and clean them up for viewCleanup. It should be + * unique, so that indexer plugins don't collide with each other. + * mapper: function (mapFunDef, emit) + * Returns a map function based on the mapFunDef, which in the case of + * normal map/reduce is just the de-stringified function, but may be + * something else, such as an object in the case of pouchdb-find. + * reducer: function (reduceFunDef) + * Ditto, but for reducing. Modules don't have to support reducing + * (e.g. pouchdb-find). + * ddocValidator: function (ddoc, viewName) + * Throws an error if the ddoc or viewName is not valid. + * This could be a way to communicate to the user that the configuration for the + * indexer is invalid. + */ +function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) { + + function tryMap(db, fun, doc) { + // emit an event if there was an error thrown by a map function. + // putting try/catches in a single function also avoids deoptimizations. + try { + fun(doc); + } catch (e) { + emitError(db, e); + } + } + + function tryReduce(db, fun, keys, values, rereduce) { + // same as above, but returning the result or an error. there are two separate + // functions to avoid extra memory allocations since the tryCode() case is used + // for custom map functions (common) vs this function, which is only used for + // custom reduce functions (rare) + try { + return {output : fun(keys, values, rereduce)}; + } catch (e) { + emitError(db, e); + return {error: e}; + } + } + + function sortByKeyThenValue(x, y) { + var keyCompare = pouchdbCollate.collate(x.key, y.key); + return keyCompare !== 0 ? keyCompare : pouchdbCollate.collate(x.value, y.value); + } + + function sliceResults(results, limit, skip) { + skip = skip || 0; + if (typeof limit === 'number') { + return results.slice(skip, limit + skip); + } else if (skip > 0) { + return results.slice(skip); + } + return results; + } + + function rowToDocId(row) { + var val = row.value; + // Users can explicitly specify a joined doc _id, or it + // defaults to the doc _id that emitted the key/value. + var docId = (val && typeof val === 'object' && val._id) || row.id; + return docId; + } + + function readAttachmentsAsBlobOrBuffer(res) { + res.rows.forEach(function (row) { + var atts = row.doc && row.doc._attachments; + if (!atts) { + return; + } + Object.keys(atts).forEach(function (filename) { + var att = atts[filename]; + atts[filename].data = pouchdbBinaryUtils.base64StringToBlobOrBuffer(att.data, att.content_type); }); }); } - function hasAttachments(doc) { - return doc._attachments && Object.keys(doc._attachments).length > 0; + function postprocessAttachments(opts) { + return function (res) { + if (opts.include_docs && opts.attachments && opts.binary) { + readAttachmentsAsBlobOrBuffer(res); + } + return res; + }; } - function hasConflicts(doc) { - return doc._conflicts && doc._conflicts.length > 0; + function addHttpParam(paramName, opts, params, asJson) { + // add an http param from opts to params, optionally json-encoded + var val = opts[paramName]; + if (typeof val !== 'undefined') { + if (asJson) { + val = encodeURIComponent(JSON.stringify(val)); + } + params.push(paramName + '=' + val); + } } - function fetchRevisionOneDocs(ids) { - // Optimization: fetch gen-1 docs and attachments in - // a single request using _all_docs - return src.allDocs({ - keys: ids, - include_docs: true, - conflicts: true - }).then(function (res) { - if (state.cancelled) { - throw new Error('cancelled'); + function coerceInteger(integerCandidate) { + if (typeof integerCandidate !== 'undefined') { + var asNumber = Number(integerCandidate); + // prevents e.g. '1foo' or '1.1' being coerced to 1 + if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) { + return asNumber; + } else { + return integerCandidate; } - res.rows.forEach(function (row) { - if (row.deleted || !row.doc || !isGenOne(row.value.rev) || - hasAttachments(row.doc) || hasConflicts(row.doc)) { - // if any of these conditions apply, we need to fetch using get() - return; + } + } + + function coerceOptions(opts) { + opts.group_level = coerceInteger(opts.group_level); + opts.limit = coerceInteger(opts.limit); + opts.skip = coerceInteger(opts.skip); + return opts; + } + + function checkPositiveInteger(number) { + if (number) { + if (typeof number !== 'number') { + return new pouchdbMapreduceUtils.QueryParseError('Invalid value for integer: "' + + number + '"'); + } + if (number < 0) { + return new pouchdbMapreduceUtils.QueryParseError('Invalid value for positive integer: ' + + '"' + number + '"'); + } + } + } + + function checkQueryParseError(options, fun) { + var startkeyName = options.descending ? 'endkey' : 'startkey'; + var endkeyName = options.descending ? 'startkey' : 'endkey'; + + if (typeof options[startkeyName] !== 'undefined' && + typeof options[endkeyName] !== 'undefined' && + pouchdbCollate.collate(options[startkeyName], options[endkeyName]) > 0) { + throw new pouchdbMapreduceUtils.QueryParseError('No rows can match your key range, ' + + 'reverse your start_key and end_key or set {descending : true}'); + } else if (fun.reduce && options.reduce !== false) { + if (options.include_docs) { + throw new pouchdbMapreduceUtils.QueryParseError('{include_docs:true} is invalid for reduce'); + } else if (options.keys && options.keys.length > 1 && + !options.group && !options.group_level) { + throw new pouchdbMapreduceUtils.QueryParseError('Multi-key fetches for reduce views must use ' + + '{group: true}'); + } + } + ['group_level', 'limit', 'skip'].forEach(function (optionName) { + var error = checkPositiveInteger(options[optionName]); + if (error) { + throw error; + } + }); + } + + function httpQuery(db, fun, opts) { + // List of parameters to add to the PUT request + var params = []; + var body; + var method = 'GET'; + + // If opts.reduce exists and is defined, then add it to the list + // of parameters. + // If reduce=false then the results are that of only the map function + // not the final result of map and reduce. + addHttpParam('reduce', opts, params); + addHttpParam('include_docs', opts, params); + addHttpParam('attachments', opts, params); + addHttpParam('limit', opts, params); + addHttpParam('descending', opts, params); + addHttpParam('group', opts, params); + addHttpParam('group_level', opts, params); + addHttpParam('skip', opts, params); + addHttpParam('stale', opts, params); + addHttpParam('conflicts', opts, params); + addHttpParam('startkey', opts, params, true); + addHttpParam('start_key', opts, params, true); + addHttpParam('endkey', opts, params, true); + addHttpParam('end_key', opts, params, true); + addHttpParam('inclusive_end', opts, params); + addHttpParam('key', opts, params, true); + addHttpParam('update_seq', opts, params); + + // Format the list of parameters into a valid URI query string + params = params.join('&'); + params = params === '' ? '' : '?' + params; + + // If keys are supplied, issue a POST to circumvent GET query string limits + // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options + if (typeof opts.keys !== 'undefined') { + var MAX_URL_LENGTH = 2000; + // according to http://stackoverflow.com/a/417184/680742, + // the de facto URL length limit is 2000 characters + + var keysAsString = + 'keys=' + encodeURIComponent(JSON.stringify(opts.keys)); + if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) { + // If the keys are short enough, do a GET. we do this to work around + // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239) + params += (params[0] === '?' ? '&' : '?') + keysAsString; + } else { + method = 'POST'; + if (typeof fun === 'string') { + body = {keys: opts.keys}; + } else { // fun is {map : mapfun}, so append to this + fun.keys = opts.keys; } + } + } - // strip _conflicts array to appease CSG (#5793) - /* istanbul ignore if */ - if (row.doc._conflicts) { - delete row.doc._conflicts; + // We are referencing a query defined in the design doc + if (typeof fun === 'string') { + var parts = parseViewName(fun); + return db.request({ + method: method, + url: '_design/' + parts[0] + '/_view/' + parts[1] + params, + body: body + }).then( + /* istanbul ignore next */ + function (result) { + // fail the entire request if the result contains an error + result.rows.forEach(function (row) { + if (row.value && row.value.error && row.value.error === "builtin_reduce_error") { + throw new Error(row.reason); + } + }); + + return result; + }) + .then(postprocessAttachments(opts)); + } + + // We are using a temporary view, terrible for performance, good for testing + body = body || {}; + Object.keys(fun).forEach(function (key) { + if (Array.isArray(fun[key])) { + body[key] = fun[key]; + } else { + body[key] = fun[key].toString(); + } + }); + return db.request({ + method: 'POST', + url: '_temp_view' + params, + body: body + }).then(postprocessAttachments(opts)); + } + + // custom adapters can define their own api._query + // and override the default behavior + /* istanbul ignore next */ + function customQuery(db, fun, opts) { + return new Promise(function (resolve, reject) { + db._query(fun, opts, function (err, res) { + if (err) { + return reject(err); } + resolve(res); + }); + }); + } - // the doc we got back from allDocs() is sufficient - resultDocs.push(row.doc); - delete diffs[row.id]; + // custom adapters can define their own api._viewCleanup + // and override the default behavior + /* istanbul ignore next */ + function customViewCleanup(db) { + return new Promise(function (resolve, reject) { + db._viewCleanup(function (err, res) { + if (err) { + return reject(err); + } + resolve(res); }); }); } - function getRevisionOneDocs() { - // filter out the generation 1 docs and get them - // leaving the non-generation one docs to be got otherwise - var ids = Object.keys(diffs).filter(function (id) { - var missing = diffs[id].missing; - return missing.length === 1 && isGenOne(missing[0]); + function defaultsTo(value) { + return function (reason) { + /* istanbul ignore else */ + if (reason.status === 404) { + return value; + } else { + throw reason; + } + }; + } + + // returns a promise for a list of docs to update, based on the input docId. + // the order doesn't matter, because post-3.2.0, bulkDocs + // is an atomic operation in all three adapters. + function getDocsToPersist(docId, view, docIdsToChangesAndEmits) { + var metaDocId = '_local/doc_' + docId; + var defaultMetaDoc = {_id: metaDocId, keys: []}; + var docData = docIdsToChangesAndEmits.get(docId); + var indexableKeysToKeyValues = docData[0]; + var changes = docData[1]; + + function getMetaDoc() { + if (isGenOne(changes)) { + // generation 1, so we can safely assume initial state + // for performance reasons (avoids unnecessary GETs) + return Promise.resolve(defaultMetaDoc); + } + return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc)); + } + + function getKeyValueDocs(metaDoc) { + if (!metaDoc.keys.length) { + // no keys, no need for a lookup + return Promise.resolve({rows: []}); + } + return view.db.allDocs({ + keys: metaDoc.keys, + include_docs: true + }); + } + + function processKeyValueDocs(metaDoc, kvDocsRes) { + var kvDocs = []; + var oldKeys = new pouchdbCollections.Set(); + + for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) { + var row = kvDocsRes.rows[i]; + var doc = row.doc; + if (!doc) { // deleted + continue; + } + kvDocs.push(doc); + oldKeys.add(doc._id); + doc._deleted = !indexableKeysToKeyValues.has(doc._id); + if (!doc._deleted) { + var keyValue = indexableKeysToKeyValues.get(doc._id); + if ('value' in keyValue) { + doc.value = keyValue.value; + } + } + } + var newKeys = pouchdbMapreduceUtils.mapToKeysArray(indexableKeysToKeyValues); + newKeys.forEach(function (key) { + if (!oldKeys.has(key)) { + // new doc + var kvDoc = { + _id: key + }; + var keyValue = indexableKeysToKeyValues.get(key); + if ('value' in keyValue) { + kvDoc.value = keyValue.value; + } + kvDocs.push(kvDoc); + } + }); + metaDoc.keys = pouchdbMapreduceUtils.uniq(newKeys.concat(metaDoc.keys)); + kvDocs.push(metaDoc); + + return kvDocs; + } + + return getMetaDoc().then(function (metaDoc) { + return getKeyValueDocs(metaDoc).then(function (kvDocsRes) { + return processKeyValueDocs(metaDoc, kvDocsRes); + }); }); - if (ids.length > 0) { - return fetchRevisionOneDocs(ids); + } + + // updates all emitted key/value docs and metaDocs in the mrview database + // for the given batch of documents from the source database + function saveKeyValues(view, docIdsToChangesAndEmits, seq) { + var seqDocId = '_local/lastSeq'; + return view.db.get(seqDocId) + .catch(defaultsTo({_id: seqDocId, seq: 0})) + .then(function (lastSeqDoc) { + var docIds = pouchdbMapreduceUtils.mapToKeysArray(docIdsToChangesAndEmits); + return Promise.all(docIds.map(function (docId) { + return getDocsToPersist(docId, view, docIdsToChangesAndEmits); + })).then(function (listOfDocsToPersist) { + var docsToPersist = pouchdbUtils.flatten(listOfDocsToPersist); + lastSeqDoc.seq = seq; + docsToPersist.push(lastSeqDoc); + // write all docs in a single operation, update the seq once + return view.db.bulkDocs({docs : docsToPersist}); + }); + }); + } + + function getQueue(view) { + var viewName = typeof view === 'string' ? view : view.name; + var queue = persistentQueues[viewName]; + if (!queue) { + queue = persistentQueues[viewName] = new TaskQueue(); } + return queue; } - function returnResult() { - return { ok:ok, docs:resultDocs }; + function updateView(view) { + return pouchdbMapreduceUtils.sequentialize(getQueue(view), function () { + return updateViewInQueue(view); + })(); } - return Promise.resolve() - .then(getRevisionOneDocs) - .then(getAllDocs) - .then(returnResult); -} + function updateViewInQueue(view) { + // bind the emit function once + var mapResults; + var doc; -var STARTING_BACK_OFF = 0; + function emit(key, value) { + var output = {id: doc._id, key: pouchdbCollate.normalizeKey(key)}; + // Don't explicitly store the value unless it's defined and non-null. + // This saves on storage space, because often people don't use it. + if (typeof value !== 'undefined' && value !== null) { + output.value = pouchdbCollate.normalizeKey(value); + } + mapResults.push(output); + } -function backOff(opts, returnValue, error, callback) { - if (opts.retry === false) { - returnValue.emit('error', error); - returnValue.removeAllListeners(); - return; + var mapFun = mapper(view.mapFun, emit); + + var currentSeq = view.seq || 0; + + function processChange(docIdsToChangesAndEmits, seq) { + return function () { + return saveKeyValues(view, docIdsToChangesAndEmits, seq); + }; + } + + var queue = new TaskQueue(); + + function processNextBatch() { + return view.sourceDB.changes({ + conflicts: true, + include_docs: true, + style: 'all_docs', + since: currentSeq, + limit: CHANGES_BATCH_SIZE + }).then(processBatch); + } + + function processBatch(response) { + var results = response.results; + if (!results.length) { + return; + } + var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results); + queue.add(processChange(docIdsToChangesAndEmits, currentSeq)); + if (results.length < CHANGES_BATCH_SIZE) { + return; + } + return processNextBatch(); + } + + function createDocIdsToChangesAndEmits(results) { + var docIdsToChangesAndEmits = new pouchdbCollections.Map(); + for (var i = 0, len = results.length; i < len; i++) { + var change = results[i]; + if (change.doc._id[0] !== '_') { + mapResults = []; + doc = change.doc; + + if (!doc._deleted) { + tryMap(view.sourceDB, mapFun, doc); + } + mapResults.sort(sortByKeyThenValue); + + var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults); + docIdsToChangesAndEmits.set(change.doc._id, [ + indexableKeysToKeyValues, + change.changes + ]); + } + currentSeq = change.seq; + } + return docIdsToChangesAndEmits; + } + + function createIndexableKeysToKeyValues(mapResults) { + var indexableKeysToKeyValues = new pouchdbCollections.Map(); + var lastKey; + for (var i = 0, len = mapResults.length; i < len; i++) { + var emittedKeyValue = mapResults[i]; + var complexKey = [emittedKeyValue.key, emittedKeyValue.id]; + if (i > 0 && pouchdbCollate.collate(emittedKeyValue.key, lastKey) === 0) { + complexKey.push(i); // dup key+id, so make it unique + } + indexableKeysToKeyValues.set(pouchdbCollate.toIndexableString(complexKey), emittedKeyValue); + lastKey = emittedKeyValue.key; + } + return indexableKeysToKeyValues; + } + + return processNextBatch().then(function () { + return queue.finish(); + }).then(function () { + view.seq = currentSeq; + }); } - if (typeof opts.back_off_function !== 'function') { - opts.back_off_function = pouchdbUtils.defaultBackOff; + + function reduceView(view, results, options) { + if (options.group_level === 0) { + delete options.group_level; + } + + var shouldGroup = options.group || options.group_level; + + var reduceFun = reducer(view.reduceFun); + + var groups = []; + var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY : + options.group_level; + results.forEach(function (e) { + var last = groups[groups.length - 1]; + var groupKey = shouldGroup ? e.key : null; + + // only set group_level for array keys + if (shouldGroup && Array.isArray(groupKey)) { + groupKey = groupKey.slice(0, lvl); + } + + if (last && pouchdbCollate.collate(last.groupKey, groupKey) === 0) { + last.keys.push([e.key, e.id]); + last.values.push(e.value); + return; + } + groups.push({ + keys: [[e.key, e.id]], + values: [e.value], + groupKey: groupKey + }); + }); + results = []; + for (var i = 0, len = groups.length; i < len; i++) { + var e = groups[i]; + var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false); + if (reduceTry.error && reduceTry.error instanceof pouchdbMapreduceUtils.BuiltInError) { + // CouchDB returns an error if a built-in errors out + throw reduceTry.error; + } + results.push({ + // CouchDB just sets the value to null if a non-built-in errors out + value: reduceTry.error ? null : reduceTry.output, + key: e.groupKey + }); + } + // no total_rows/offset when reducing + return {rows: sliceResults(results, options.limit, options.skip)}; } - returnValue.emit('requestError', error); - if (returnValue.state === 'active' || returnValue.state === 'pending') { - returnValue.emit('paused', error); - returnValue.state = 'stopped'; - var backOffSet = function backoffTimeSet() { - opts.current_back_off = STARTING_BACK_OFF; - }; - var removeBackOffSetter = function removeBackOffTimeSet() { - returnValue.removeListener('active', backOffSet); - }; - returnValue.once('paused', removeBackOffSetter); - returnValue.once('active', backOffSet); + + function queryView(view, opts) { + return pouchdbMapreduceUtils.sequentialize(getQueue(view), function () { + return queryViewInQueue(view, opts); + })(); + } + + function queryViewInQueue(view, opts) { + var totalRows; + var shouldReduce = view.reduceFun && opts.reduce !== false; + var skip = opts.skip || 0; + if (typeof opts.keys !== 'undefined' && !opts.keys.length) { + // equivalent query + opts.limit = 0; + delete opts.keys; + } + + function fetchFromView(viewOpts) { + viewOpts.include_docs = true; + return view.db.allDocs(viewOpts).then(function (res) { + totalRows = res.total_rows; + return res.rows.map(function (result) { + + // implicit migration - in older versions of PouchDB, + // we explicitly stored the doc as {id: ..., key: ..., value: ...} + // this is tested in a migration test + /* istanbul ignore next */ + if ('value' in result.doc && typeof result.doc.value === 'object' && + result.doc.value !== null) { + var keys = Object.keys(result.doc.value).sort(); + // this detection method is not perfect, but it's unlikely the user + // emitted a value which was an object with these 3 exact keys + var expectedKeys = ['id', 'key', 'value']; + if (!(keys < expectedKeys || keys > expectedKeys)) { + return result.doc.value; + } + } + + var parsedKeyAndDocId = pouchdbCollate.parseIndexableString(result.doc._id); + return { + key: parsedKeyAndDocId[0], + id: parsedKeyAndDocId[1], + value: ('value' in result.doc ? result.doc.value : null) + }; + }); + }); + } + + function onMapResultsReady(rows) { + var finalResults; + if (shouldReduce) { + finalResults = reduceView(view, rows, opts); + } else { + finalResults = { + total_rows: totalRows, + offset: skip, + rows: rows + }; + } + /* istanbul ignore if */ + if (opts.update_seq) { + finalResults.update_seq = view.seq; + } + if (opts.include_docs) { + var docIds = pouchdbMapreduceUtils.uniq(rows.map(rowToDocId)); + + return view.sourceDB.allDocs({ + keys: docIds, + include_docs: true, + conflicts: opts.conflicts, + attachments: opts.attachments, + binary: opts.binary + }).then(function (allDocsRes) { + var docIdsToDocs = new pouchdbCollections.Map(); + allDocsRes.rows.forEach(function (row) { + docIdsToDocs.set(row.id, row.doc); + }); + rows.forEach(function (row) { + var docId = rowToDocId(row); + var doc = docIdsToDocs.get(docId); + if (doc) { + row.doc = doc; + } + }); + return finalResults; + }); + } else { + return finalResults; + } + } + + if (typeof opts.keys !== 'undefined') { + var keys = opts.keys; + var fetchPromises = keys.map(function (key) { + var viewOpts = { + startkey : pouchdbCollate.toIndexableString([key]), + endkey : pouchdbCollate.toIndexableString([key, {}]) + }; + /* istanbul ignore if */ + if (opts.update_seq) { + viewOpts.update_seq = true; + } + return fetchFromView(viewOpts); + }); + return Promise.all(fetchPromises).then(pouchdbUtils.flatten).then(onMapResultsReady); + } else { // normal query, no 'keys' + var viewOpts = { + descending : opts.descending + }; + /* istanbul ignore if */ + if (opts.update_seq) { + viewOpts.update_seq = true; + } + var startkey; + var endkey; + if ('start_key' in opts) { + startkey = opts.start_key; + } + if ('startkey' in opts) { + startkey = opts.startkey; + } + if ('end_key' in opts) { + endkey = opts.end_key; + } + if ('endkey' in opts) { + endkey = opts.endkey; + } + if (typeof startkey !== 'undefined') { + viewOpts.startkey = opts.descending ? + pouchdbCollate.toIndexableString([startkey, {}]) : + pouchdbCollate.toIndexableString([startkey]); + } + if (typeof endkey !== 'undefined') { + var inclusiveEnd = opts.inclusive_end !== false; + if (opts.descending) { + inclusiveEnd = !inclusiveEnd; + } + + viewOpts.endkey = pouchdbCollate.toIndexableString( + inclusiveEnd ? [endkey, {}] : [endkey]); + } + if (typeof opts.key !== 'undefined') { + var keyStart = pouchdbCollate.toIndexableString([opts.key]); + var keyEnd = pouchdbCollate.toIndexableString([opts.key, {}]); + if (viewOpts.descending) { + viewOpts.endkey = keyStart; + viewOpts.startkey = keyEnd; + } else { + viewOpts.startkey = keyStart; + viewOpts.endkey = keyEnd; + } + } + if (!shouldReduce) { + if (typeof opts.limit === 'number') { + viewOpts.limit = opts.limit; + } + viewOpts.skip = skip; + } + return fetchFromView(viewOpts).then(onMapResultsReady); + } + } + + function httpViewCleanup(db) { + return db.request({ + method: 'POST', + url: '_view_cleanup' + }); + } + + function localViewCleanup(db) { + return db.get('_local/' + localDocName).then(function (metaDoc) { + var docsToViews = new pouchdbCollections.Map(); + Object.keys(metaDoc.views).forEach(function (fullViewName) { + var parts = parseViewName(fullViewName); + var designDocName = '_design/' + parts[0]; + var viewName = parts[1]; + var views = docsToViews.get(designDocName); + if (!views) { + views = new pouchdbCollections.Set(); + docsToViews.set(designDocName, views); + } + views.add(viewName); + }); + var opts = { + keys : pouchdbMapreduceUtils.mapToKeysArray(docsToViews), + include_docs : true + }; + return db.allDocs(opts).then(function (res) { + var viewsToStatus = {}; + res.rows.forEach(function (row) { + var ddocName = row.key.substring(8); // cuts off '_design/' + docsToViews.get(row.key).forEach(function (viewName) { + var fullViewName = ddocName + '/' + viewName; + /* istanbul ignore if */ + if (!metaDoc.views[fullViewName]) { + // new format, without slashes, to support PouchDB 2.2.0 + // migration test in pouchdb's browser.migration.js verifies this + fullViewName = viewName; + } + var viewDBNames = Object.keys(metaDoc.views[fullViewName]); + // design doc deleted, or view function nonexistent + var statusIsGood = row.doc && row.doc.views && + row.doc.views[viewName]; + viewDBNames.forEach(function (viewDBName) { + viewsToStatus[viewDBName] = + viewsToStatus[viewDBName] || statusIsGood; + }); + }); + }); + var dbsToDelete = Object.keys(viewsToStatus).filter( + function (viewDBName) { return !viewsToStatus[viewDBName]; }); + var destroyPromises = dbsToDelete.map(function (viewDBName) { + return pouchdbMapreduceUtils.sequentialize(getQueue(viewDBName), function () { + return new db.constructor(viewDBName, db.__opts).destroy(); + })(); + }); + return Promise.all(destroyPromises).then(function () { + return {ok: true}; + }); + }); + }, defaultsTo({ok: true})); + } + + function queryPromised(db, fun, opts) { + /* istanbul ignore next */ + if (typeof db._query === 'function') { + return customQuery(db, fun, opts); + } + if (pouchdbUtils.isRemote(db)) { + return httpQuery(db, fun, opts); + } + + if (typeof fun !== 'string') { + // temp_view + checkQueryParseError(opts, fun); + + tempViewQueue.add(function () { + var createViewPromise = createView( + /* sourceDB */ db, + /* viewName */ 'temp_view/temp_view', + /* mapFun */ fun.map, + /* reduceFun */ fun.reduce, + /* temporary */ true, + /* localDocName */ localDocName); + return createViewPromise.then(function (view) { + return pouchdbMapreduceUtils.fin(updateView(view).then(function () { + return queryView(view, opts); + }), function () { + return view.db.destroy(); + }); + }); + }); + return tempViewQueue.finish(); + } else { + // persistent view + var fullViewName = fun; + var parts = parseViewName(fullViewName); + var designDocName = parts[0]; + var viewName = parts[1]; + return db.get('_design/' + designDocName).then(function (doc) { + var fun = doc.views && doc.views[viewName]; + + if (!fun) { + // basic validator; it's assumed that every subclass would want this + throw new pouchdbMapreduceUtils.NotFoundError('ddoc ' + doc._id + ' has no view named ' + + viewName); + } + + ddocValidator(doc, viewName); + checkQueryParseError(opts, fun); + + var createViewPromise = createView( + /* sourceDB */ db, + /* viewName */ fullViewName, + /* mapFun */ fun.map, + /* reduceFun */ fun.reduce, + /* temporary */ false, + /* localDocName */ localDocName); + return createViewPromise.then(function (view) { + if (opts.stale === 'ok' || opts.stale === 'update_after') { + if (opts.stale === 'update_after') { + pouchdbUtils.nextTick(function () { + updateView(view); + }); + } + return queryView(view, opts); + } else { // stale not ok + return updateView(view).then(function () { + return queryView(view, opts); + }); + } + }); + }); + } + } + + function abstractQuery(fun, opts, callback) { + var db = this; + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + opts = opts ? coerceOptions(opts) : {}; + + if (typeof fun === 'function') { + fun = {map : fun}; + } + + var promise = Promise.resolve().then(function () { + return queryPromised(db, fun, opts); + }); + pouchdbMapreduceUtils.promisedCallback(promise, callback); + return promise; } - opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF; - opts.current_back_off = opts.back_off_function(opts.current_back_off); - setTimeout(callback, opts.current_back_off); -} - -function replicate(src, target, opts, returnValue, result) { - var batches = []; // list of batches to be processed - var currentBatch; // the batch currently being processed - var pendingBatch = { - seq: 0, - changes: [], - docs: [] - }; // next batch, not yet ready to be processed - var writingCheckpoint = false; // true while checkpoint is being written - var changesCompleted = false; // true when all changes received - var replicationCompleted = false; // true when replication has completed - var last_seq = 0; - var continuous = opts.continuous || opts.live || false; - var batch_size = opts.batch_size || 100; - var batches_limit = opts.batches_limit || 10; - var changesPending = false; // true while src.changes is running - var doc_ids = opts.doc_ids; - var selector = opts.selector; - var repId; - var checkpointer; - var changedDocs = []; - // Like couchdb, every replication gets a unique session id - var session = pouchdbUtils.uuid(); - var seq_interval = opts.seq_interval; + var abstractViewCleanup = pouchdbMapreduceUtils.callbackify(function () { + var db = this; + /* istanbul ignore next */ + if (typeof db._viewCleanup === 'function') { + return customViewCleanup(db); + } + if (pouchdbUtils.isRemote(db)) { + return httpViewCleanup(db); + } + return localViewCleanup(db); + }); - result = result || { - ok: true, - start_time: new Date(), - docs_read: 0, - docs_written: 0, - doc_write_failures: 0, - errors: [] + return { + query: abstractQuery, + viewCleanup: abstractViewCleanup }; +} - var changesOpts = {}; - returnValue.ready(src, target); +module.exports = createAbstractMapReduce; - function initCheckpointer() { - if (checkpointer) { - return Promise.resolve(); - } - return generateReplicationId(src, target, opts).then(function (res) { - repId = res; +},{"pouchdb-binary-utils":553,"pouchdb-collate":554,"pouchdb-collections":555,"pouchdb-mapreduce-utils":557,"pouchdb-md5":558,"pouchdb-promise":559,"pouchdb-utils":560}],553:[function(require,module,exports){ +arguments[4][507][0].apply(exports,arguments) +},{"dup":507}],554:[function(require,module,exports){ +'use strict'; - var checkpointOpts = {}; - if (opts.checkpoint === false) { - checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false }; - } else if (opts.checkpoint === 'source') { - checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false }; - } else if (opts.checkpoint === 'target') { - checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true }; - } else { - checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true }; - } +Object.defineProperty(exports, '__esModule', { value: true }); - checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts); - }); +function pad(str, padWith, upToLength) { + var padding = ''; + var targetLength = upToLength - str.length; + /* istanbul ignore next */ + while (padding.length < targetLength) { + padding += padWith; } + return padding; +} - function writeDocs() { - changedDocs = []; +function padLeft(str, padWith, upToLength) { + var padding = pad(str, padWith, upToLength); + return padding + str; +} - if (currentBatch.docs.length === 0) { - return; - } - var docs = currentBatch.docs; - var bulkOpts = {timeout: opts.timeout}; - return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) { - /* istanbul ignore if */ - if (returnValue.cancelled) { - completeReplication(); - throw new Error('cancelled'); - } +var MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE +var MAGNITUDE_DIGITS = 3; // ditto +var SEP = ''; // set to '_' for easier debugging - // `res` doesn't include full documents (which live in `docs`), so we create a map of - // (id -> error), and check for errors while iterating over `docs` - var errorsById = Object.create(null); - res.forEach(function (res) { - if (res.error) { - errorsById[res.id] = res; - } - }); +function collate(a, b) { - var errorsNo = Object.keys(errorsById).length; - result.doc_write_failures += errorsNo; - result.docs_written += docs.length - errorsNo; + if (a === b) { + return 0; + } - docs.forEach(function (doc) { - var error = errorsById[doc._id]; - if (error) { - result.errors.push(error); - // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) - var errorName = (error.name || '').toLowerCase(); - if (errorName === 'unauthorized' || errorName === 'forbidden') { - returnValue.emit('denied', pouchdbUtils.clone(error)); - } else { - throw error; - } - } else { - changedDocs.push(doc); - } - }); + a = normalizeKey(a); + b = normalizeKey(b); - }, function (err) { - result.doc_write_failures += docs.length; - throw err; - }); + var ai = collationIndex(a); + var bi = collationIndex(b); + if ((ai - bi) !== 0) { + return ai - bi; } - - function finishBatch() { - if (currentBatch.error) { - throw new Error('There was a problem getting docs.'); - } - result.last_seq = last_seq = currentBatch.seq; - var outResult = pouchdbUtils.clone(result); - if (changedDocs.length) { - outResult.docs = changedDocs; - // Attach 'pending' property if server supports it (CouchDB 2.0+) - /* istanbul ignore if */ - if (typeof currentBatch.pending === 'number') { - outResult.pending = currentBatch.pending; - delete currentBatch.pending; - } - returnValue.emit('change', outResult); - } - writingCheckpoint = true; - return checkpointer.writeCheckpoint(currentBatch.seq, - session).then(function () { - writingCheckpoint = false; - /* istanbul ignore if */ - if (returnValue.cancelled) { - completeReplication(); - throw new Error('cancelled'); - } - currentBatch = undefined; - getChanges(); - }).catch(function (err) { - onCheckpointError(err); - throw err; - }); + switch (typeof a) { + case 'number': + return a - b; + case 'boolean': + return a < b ? -1 : 1; + case 'string': + return stringCollate(a, b); } + return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b); +} - function getDiffs() { - var diff = {}; - currentBatch.changes.forEach(function (change) { - // Couchbase Sync Gateway emits these, but we can ignore them - /* istanbul ignore if */ - if (change.id === "_user/") { - return; +// couch considers null/NaN/Infinity/-Infinity === undefined, +// for the purposes of mapreduce indexes. also, dates get stringified. +function normalizeKey(key) { + switch (typeof key) { + case 'undefined': + return null; + case 'number': + if (key === Infinity || key === -Infinity || isNaN(key)) { + return null; } - diff[change.id] = change.changes.map(function (x) { - return x.rev; - }); - }); - return target.revsDiff(diff).then(function (diffs) { - /* istanbul ignore if */ - if (returnValue.cancelled) { - completeReplication(); - throw new Error('cancelled'); + return key; + case 'object': + var origKey = key; + if (Array.isArray(key)) { + var len = key.length; + key = new Array(len); + for (var i = 0; i < len; i++) { + key[i] = normalizeKey(origKey[i]); + } + /* istanbul ignore next */ + } else if (key instanceof Date) { + return key.toJSON(); + } else if (key !== null) { // generic object + key = {}; + for (var k in origKey) { + if (origKey.hasOwnProperty(k)) { + var val = origKey[k]; + if (typeof val !== 'undefined') { + key[k] = normalizeKey(val); + } + } + } } - // currentBatch.diffs elements are deleted as the documents are written - currentBatch.diffs = diffs; - }); - } - - function getBatchDocs() { - return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) { - currentBatch.error = !got.ok; - got.docs.forEach(function (doc) { - delete currentBatch.diffs[doc._id]; - result.docs_read++; - currentBatch.docs.push(doc); - }); - }); } + return key; +} - function startNextBatch() { - if (returnValue.cancelled || currentBatch) { - return; - } - if (batches.length === 0) { - processPendingBatch(true); - return; +function indexify(key) { + if (key !== null) { + switch (typeof key) { + case 'boolean': + return key ? 1 : 0; + case 'number': + return numToIndexableString(key); + case 'string': + // We've to be sure that key does not contain \u0000 + // Do order-preserving replacements: + // 0 -> 1, 1 + // 1 -> 1, 2 + // 2 -> 2, 2 + return key + .replace(/\u0002/g, '\u0002\u0002') + .replace(/\u0001/g, '\u0001\u0002') + .replace(/\u0000/g, '\u0001\u0001'); + case 'object': + var isArray = Array.isArray(key); + var arr = isArray ? key : Object.keys(key); + var i = -1; + var len = arr.length; + var result = ''; + if (isArray) { + while (++i < len) { + result += toIndexableString(arr[i]); + } + } else { + while (++i < len) { + var objKey = arr[i]; + result += toIndexableString(objKey) + + toIndexableString(key[objKey]); + } + } + return result; } - currentBatch = batches.shift(); - getDiffs() - .then(getBatchDocs) - .then(writeDocs) - .then(finishBatch) - .then(startNextBatch) - .catch(function (err) { - abortReplication('batch processing terminated with error', err); - }); } + return ''; +} +// convert the given key to a string that would be appropriate +// for lexical sorting, e.g. within a database, where the +// sorting is the same given by the collate() function. +function toIndexableString(key) { + var zero = '\u0000'; + key = normalizeKey(key); + return collationIndex(key) + SEP + indexify(key) + zero; +} - function processPendingBatch(immediate) { - if (pendingBatch.changes.length === 0) { - if (batches.length === 0 && !currentBatch) { - if ((continuous && changesOpts.live) || changesCompleted) { - returnValue.state = 'pending'; - returnValue.emit('paused'); - } - if (changesCompleted) { - completeReplication(); - } - } - return; +function parseNumber(str, i) { + var originalIdx = i; + var num; + var zero = str[i] === '1'; + if (zero) { + num = 0; + i++; + } else { + var neg = str[i] === '0'; + i++; + var numAsString = ''; + var magAsString = str.substring(i, i + MAGNITUDE_DIGITS); + var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE; + /* istanbul ignore next */ + if (neg) { + magnitude = -magnitude; } - if ( - immediate || - changesCompleted || - pendingBatch.changes.length >= batch_size - ) { - batches.push(pendingBatch); - pendingBatch = { - seq: 0, - changes: [], - docs: [] - }; - if (returnValue.state === 'pending' || returnValue.state === 'stopped') { - returnValue.state = 'active'; - returnValue.emit('active'); + i += MAGNITUDE_DIGITS; + while (true) { + var ch = str[i]; + if (ch === '\u0000') { + break; + } else { + numAsString += ch; } - startNextBatch(); + i++; } - } - - - function abortReplication(reason, err) { - if (replicationCompleted) { - return; + numAsString = numAsString.split('.'); + if (numAsString.length === 1) { + num = parseInt(numAsString, 10); + } else { + /* istanbul ignore next */ + num = parseFloat(numAsString[0] + '.' + numAsString[1]); } - if (!err.message) { - err.message = reason; + /* istanbul ignore next */ + if (neg) { + num = num - 10; + } + /* istanbul ignore next */ + if (magnitude !== 0) { + // parseFloat is more reliable than pow due to rounding errors + // e.g. Number.MAX_VALUE would return Infinity if we did + // num * Math.pow(10, magnitude); + num = parseFloat(num + 'e' + magnitude); } - result.ok = false; - result.status = 'aborting'; - batches = []; - pendingBatch = { - seq: 0, - changes: [], - docs: [] - }; - completeReplication(err); } + return {num: num, length : i - originalIdx}; +} +// move up the stack while parsing +// this function moved outside of parseIndexableString for performance +function pop(stack, metaStack) { + var obj = stack.pop(); - function completeReplication(fatalError) { - if (replicationCompleted) { - return; + if (metaStack.length) { + var lastMetaElement = metaStack[metaStack.length - 1]; + if (obj === lastMetaElement.element) { + // popping a meta-element, e.g. an object whose value is another object + metaStack.pop(); + lastMetaElement = metaStack[metaStack.length - 1]; } - /* istanbul ignore if */ - if (returnValue.cancelled) { - result.status = 'cancelled'; - if (writingCheckpoint) { - return; - } + var element = lastMetaElement.element; + var lastElementIndex = lastMetaElement.index; + if (Array.isArray(element)) { + element.push(obj); + } else if (lastElementIndex === stack.length - 2) { // obj with key+value + var key = stack.pop(); + element[key] = obj; + } else { + stack.push(obj); // obj with key only } - result.status = result.status || 'complete'; - result.end_time = new Date(); - result.last_seq = last_seq; - replicationCompleted = true; + } +} - if (fatalError) { - // need to extend the error because Firefox considers ".result" read-only - fatalError = pouchdbErrors.createError(fatalError); - fatalError.result = result; +function parseIndexableString(str) { + var stack = []; + var metaStack = []; // stack for arrays and objects + var i = 0; - // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) - var errorName = (fatalError.name || '').toLowerCase(); - if (errorName === 'unauthorized' || errorName === 'forbidden') { - returnValue.emit('error', fatalError); - returnValue.removeAllListeners(); + /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ + while (true) { + var collationIndex = str[i++]; + if (collationIndex === '\u0000') { + if (stack.length === 1) { + return stack.pop(); } else { - backOff(opts, returnValue, fatalError, function () { - replicate(src, target, opts, returnValue); - }); + pop(stack, metaStack); + continue; } - } else { - returnValue.emit('complete', result); - returnValue.removeAllListeners(); + } + switch (collationIndex) { + case '1': + stack.push(null); + break; + case '2': + stack.push(str[i] === '1'); + i++; + break; + case '3': + var parsedNum = parseNumber(str, i); + stack.push(parsedNum.num); + i += parsedNum.length; + break; + case '4': + var parsedStr = ''; + /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ + while (true) { + var ch = str[i]; + if (ch === '\u0000') { + break; + } + parsedStr += ch; + i++; + } + // perform the reverse of the order-preserving replacement + // algorithm (see above) + parsedStr = parsedStr.replace(/\u0001\u0001/g, '\u0000') + .replace(/\u0001\u0002/g, '\u0001') + .replace(/\u0002\u0002/g, '\u0002'); + stack.push(parsedStr); + break; + case '5': + var arrayElement = { element: [], index: stack.length }; + stack.push(arrayElement.element); + metaStack.push(arrayElement); + break; + case '6': + var objElement = { element: {}, index: stack.length }; + stack.push(objElement.element); + metaStack.push(objElement); + break; + /* istanbul ignore next */ + default: + throw new Error( + 'bad collationIndex or unexpectedly reached end of input: ' + + collationIndex); + } + } +} + +function arrayCollate(a, b) { + var len = Math.min(a.length, b.length); + for (var i = 0; i < len; i++) { + var sort = collate(a[i], b[i]); + if (sort !== 0) { + return sort; } } - - - function onChange(change, pending, lastSeq) { - /* istanbul ignore if */ - if (returnValue.cancelled) { - return completeReplication(); + return (a.length === b.length) ? 0 : + (a.length > b.length) ? 1 : -1; +} +function stringCollate(a, b) { + // See: https://github.com/daleharvey/pouchdb/issues/40 + // This is incompatible with the CouchDB implementation, but its the + // best we can do for now + return (a === b) ? 0 : ((a > b) ? 1 : -1); +} +function objectCollate(a, b) { + var ak = Object.keys(a), bk = Object.keys(b); + var len = Math.min(ak.length, bk.length); + for (var i = 0; i < len; i++) { + // First sort the keys + var sort = collate(ak[i], bk[i]); + if (sort !== 0) { + return sort; } - // Attach 'pending' property if server supports it (CouchDB 2.0+) - /* istanbul ignore if */ - if (typeof pending === 'number') { - pendingBatch.pending = pending; + // if the keys are equal sort the values + sort = collate(a[ak[i]], b[bk[i]]); + if (sort !== 0) { + return sort; } - var filter = pouchdbUtils.filterChange(opts)(change); - if (!filter) { - return; - } - pendingBatch.seq = change.seq || lastSeq; - pendingBatch.changes.push(change); - processPendingBatch(batches.length === 0 && changesOpts.live); } - - - function onChangesComplete(changes) { - changesPending = false; - /* istanbul ignore if */ - if (returnValue.cancelled) { - return completeReplication(); + return (ak.length === bk.length) ? 0 : + (ak.length > bk.length) ? 1 : -1; +} +// The collation is defined by erlangs ordered terms +// the atoms null, true, false come first, then numbers, strings, +// arrays, then objects +// null/undefined/NaN/Infinity/-Infinity are all considered null +function collationIndex(x) { + var id = ['boolean', 'number', 'string', 'object']; + var idx = id.indexOf(typeof x); + //false if -1 otherwise true, but fast!!!!1 + if (~idx) { + if (x === null) { + return 1; } - - // if no results were returned then we're done, - // else fetch more - if (changes.results.length > 0) { - changesOpts.since = changes.last_seq; - getChanges(); - processPendingBatch(true); - } else { - - var complete = function () { - if (continuous) { - changesOpts.live = true; - getChanges(); - } else { - changesCompleted = true; - } - processPendingBatch(true); - }; - - // update the checkpoint so we start from the right seq next time - if (!currentBatch && changes.results.length === 0) { - writingCheckpoint = true; - checkpointer.writeCheckpoint(changes.last_seq, - session).then(function () { - writingCheckpoint = false; - result.last_seq = last_seq = changes.last_seq; - complete(); - }) - .catch(onCheckpointError); - } else { - complete(); - } + if (Array.isArray(x)) { + return 5; } + return idx < 3 ? (idx + 2) : (idx + 3); } - - - function onChangesError(err) { - changesPending = false; - /* istanbul ignore if */ - if (returnValue.cancelled) { - return completeReplication(); - } - abortReplication('changes rejected', err); + /* istanbul ignore next */ + if (Array.isArray(x)) { + return 5; } +} +// conversion: +// x yyy zz...zz +// x = 0 for negative, 1 for 0, 2 for positive +// y = exponent (for negative numbers negated) moved so that it's >= 0 +// z = mantisse +function numToIndexableString(num) { - function getChanges() { - if (!( - !changesPending && - !changesCompleted && - batches.length < batches_limit - )) { - return; - } - changesPending = true; - function abortChanges() { - changes.cancel(); - } - function removeListener() { - returnValue.removeListener('cancel', abortChanges); - } + if (num === 0) { + return '1'; + } - if (returnValue._changes) { // remove old changes() and listeners - returnValue.removeListener('cancel', returnValue._abortChanges); - returnValue._changes.cancel(); - } - returnValue.once('cancel', abortChanges); + // convert number to exponential format for easier and + // more succinct string sorting + var expFormat = num.toExponential().split(/e\+?/); + var magnitude = parseInt(expFormat[1], 10); - var changes = src.changes(changesOpts) - .on('change', onChange); - changes.then(removeListener, removeListener); - changes.then(onChangesComplete) - .catch(onChangesError); + var neg = num < 0; - if (opts.retry) { - // save for later so we can cancel if necessary - returnValue._changes = changes; - returnValue._abortChanges = abortChanges; - } - } + var result = neg ? '0' : '2'; + // first sort by magnitude + // it's easier if all magnitudes are positive + var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE); + var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS); - function startChanges() { - initCheckpointer().then(function () { - /* istanbul ignore if */ - if (returnValue.cancelled) { - completeReplication(); - return; - } - return checkpointer.getCheckpoint().then(function (checkpoint) { - last_seq = checkpoint; - changesOpts = { - since: last_seq, - limit: batch_size, - batch_size: batch_size, - style: 'all_docs', - doc_ids: doc_ids, - selector: selector, - return_docs: true // required so we know when we're done - }; - if (seq_interval !== false) { - changesOpts.seq_interval = seq_interval || batch_size; - } - if (opts.filter) { - if (typeof opts.filter !== 'string') { - // required for the client-side filter in onChange - changesOpts.include_docs = true; - } else { // ddoc filter - changesOpts.filter = opts.filter; - } - } - if ('heartbeat' in opts) { - changesOpts.heartbeat = opts.heartbeat; - } - if ('timeout' in opts) { - changesOpts.timeout = opts.timeout; - } - if (opts.query_params) { - changesOpts.query_params = opts.query_params; - } - if (opts.view) { - changesOpts.view = opts.view; - } - getChanges(); - }); - }).catch(function (err) { - abortReplication('getCheckpoint rejected with ', err); - }); - } + result += SEP + magString; + // then sort by the factor + var factor = Math.abs(parseFloat(expFormat[0])); // [1..10) /* istanbul ignore next */ - function onCheckpointError(err) { - writingCheckpoint = false; - abortReplication('writeCheckpoint completed with error', err); + if (neg) { // for negative reverse ordering + factor = 10 - factor; } - /* istanbul ignore if */ - if (returnValue.cancelled) { // cancelled immediately - completeReplication(); - return; - } + var factorStr = factor.toFixed(20); - if (!returnValue._addedListeners) { - returnValue.once('cancel', completeReplication); + // strip zeros from the end + factorStr = factorStr.replace(/\.?0+$/, ''); - if (typeof opts.complete === 'function') { - returnValue.once('error', opts.complete); - returnValue.once('complete', function (result) { - opts.complete(null, result); - }); - } - returnValue._addedListeners = true; - } + result += SEP + factorStr; - if (typeof opts.since === 'undefined') { - startChanges(); - } else { - initCheckpointer().then(function () { - writingCheckpoint = true; - return checkpointer.writeCheckpoint(opts.since, session); - }).then(function () { - writingCheckpoint = false; - /* istanbul ignore if */ - if (returnValue.cancelled) { - completeReplication(); - return; - } - last_seq = opts.since; - startChanges(); - }).catch(onCheckpointError); - } + return result; } -// We create a basic promise so the caller can cancel the replication possibly -// before we have actually started listening to changes etc -inherits(Replication, events.EventEmitter); -function Replication() { - events.EventEmitter.call(this); - this.cancelled = false; - this.state = 'pending'; - var self = this; - var promise = new Promise(function (fulfill, reject) { - self.once('complete', fulfill); - self.once('error', reject); - }); - self.then = function (resolve, reject) { - return promise.then(resolve, reject); - }; - self.catch = function (reject) { - return promise.catch(reject); - }; - // As we allow error handling via "error" event as well, - // put a stub in here so that rejecting never throws UnhandledError. - self.catch(function () {}); -} +exports.collate = collate; +exports.normalizeKey = normalizeKey; +exports.toIndexableString = toIndexableString; +exports.parseIndexableString = parseIndexableString; -Replication.prototype.cancel = function () { - this.cancelled = true; - this.state = 'cancelled'; - this.emit('cancel'); -}; +},{}],555:[function(require,module,exports){ +arguments[4][508][0].apply(exports,arguments) +},{"dup":508}],556:[function(require,module,exports){ +arguments[4][509][0].apply(exports,arguments) +},{"dup":509,"inherits":495}],557:[function(require,module,exports){ +'use strict'; -Replication.prototype.ready = function (src, target) { - var self = this; - if (self._readyCalled) { - return; - } - self._readyCalled = true; +Object.defineProperty(exports, '__esModule', { value: true }); - function onDestroy() { - self.cancel(); - } - src.once('destroyed', onDestroy); - target.once('destroyed', onDestroy); - function cleanup() { - src.removeListener('destroyed', onDestroy); - target.removeListener('destroyed', onDestroy); - } - self.once('complete', cleanup); -}; +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -function toPouch(db, opts) { - var PouchConstructor = opts.PouchConstructor; - if (typeof db === 'string') { - return new PouchConstructor(db, opts); - } else { - return db; - } +var inherits = _interopDefault(require('inherits')); +var pouchdbCollections = require('pouchdb-collections'); +var argsarray = _interopDefault(require('argsarray')); +var pouchdbUtils = require('pouchdb-utils'); + +function QueryParseError(message) { + this.status = 400; + this.name = 'query_parse_error'; + this.message = message; + this.error = true; + try { + Error.captureStackTrace(this, QueryParseError); + } catch (e) {} } -function replicateWrapper(src, target, opts, callback) { +inherits(QueryParseError, Error); - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - if (typeof opts === 'undefined') { - opts = {}; - } +function NotFoundError(message) { + this.status = 404; + this.name = 'not_found'; + this.message = message; + this.error = true; + try { + Error.captureStackTrace(this, NotFoundError); + } catch (e) {} +} - if (opts.doc_ids && !Array.isArray(opts.doc_ids)) { - throw pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, - "`doc_ids` filter parameter is not a list."); - } +inherits(NotFoundError, Error); - opts.complete = callback; - opts = pouchdbUtils.clone(opts); - opts.continuous = opts.continuous || opts.live; - opts.retry = ('retry' in opts) ? opts.retry : false; - /*jshint validthis:true */ - opts.PouchConstructor = opts.PouchConstructor || this; - var replicateRet = new Replication(opts); - var srcPouch = toPouch(src, opts); - var targetPouch = toPouch(target, opts); - replicate(srcPouch, targetPouch, opts, replicateRet); - return replicateRet; +function BuiltInError(message) { + this.status = 500; + this.name = 'invalid_value'; + this.message = message; + this.error = true; + try { + Error.captureStackTrace(this, BuiltInError); + } catch (e) {} } -inherits(Sync, events.EventEmitter); -function sync$1(src, target, opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = {}; - } - if (typeof opts === 'undefined') { - opts = {}; +inherits(BuiltInError, Error); + +function promisedCallback(promise, callback) { + if (callback) { + promise.then(function (res) { + pouchdbUtils.nextTick(function () { + callback(null, res); + }); + }, function (reason) { + pouchdbUtils.nextTick(function () { + callback(reason); + }); + }); } - opts = pouchdbUtils.clone(opts); - /*jshint validthis:true */ - opts.PouchConstructor = opts.PouchConstructor || this; - src = toPouch(src, opts); - target = toPouch(target, opts); - return new Sync(src, target, opts, callback); + return promise; } -function Sync(src, target, opts, callback) { - var self = this; - this.canceled = false; - - var optsPush = opts.push ? pouchdbUtils.assign({}, opts, opts.push) : opts; - var optsPull = opts.pull ? pouchdbUtils.assign({}, opts, opts.pull) : opts; - - this.push = replicateWrapper(src, target, optsPush); - this.pull = replicateWrapper(target, src, optsPull); - - this.pushPaused = true; - this.pullPaused = true; +function callbackify(fun) { + return argsarray(function (args) { + var cb = args.pop(); + var promise = fun.apply(this, args); + if (typeof cb === 'function') { + promisedCallback(promise, cb); + } + return promise; + }); +} - function pullChange(change) { - self.emit('change', { - direction: 'pull', - change: change - }); - } - function pushChange(change) { - self.emit('change', { - direction: 'push', - change: change +// Promise finally util similar to Q.finally +function fin(promise, finalPromiseFactory) { + return promise.then(function (res) { + return finalPromiseFactory().then(function () { + return res; }); - } - function pushDenied(doc) { - self.emit('denied', { - direction: 'push', - doc: doc + }, function (reason) { + return finalPromiseFactory().then(function () { + throw reason; }); - } - function pullDenied(doc) { - self.emit('denied', { - direction: 'pull', - doc: doc + }); +} + +function sequentialize(queue, promiseFactory) { + return function () { + var args = arguments; + var that = this; + return queue.add(function () { + return promiseFactory.apply(that, args); }); - } - function pushPaused() { - self.pushPaused = true; - /* istanbul ignore if */ - if (self.pullPaused) { - self.emit('paused'); - } - } - function pullPaused() { - self.pullPaused = true; - /* istanbul ignore if */ - if (self.pushPaused) { - self.emit('paused'); - } - } - function pushActive() { - self.pushPaused = false; - /* istanbul ignore if */ - if (self.pullPaused) { - self.emit('active', { - direction: 'push' - }); - } - } - function pullActive() { - self.pullPaused = false; - /* istanbul ignore if */ - if (self.pushPaused) { - self.emit('active', { - direction: 'pull' - }); - } - } + }; +} + +// uniq an array of strings, order not guaranteed +// similar to underscore/lodash _.uniq +function uniq(arr) { + var theSet = new pouchdbCollections.Set(arr); + var result = new Array(theSet.size); + var index = -1; + theSet.forEach(function (value) { + result[++index] = value; + }); + return result; +} + +function mapToKeysArray(map) { + var result = new Array(map.size); + var index = -1; + map.forEach(function (value, key) { + result[++index] = key; + }); + return result; +} + +exports.uniq = uniq; +exports.sequentialize = sequentialize; +exports.fin = fin; +exports.callbackify = callbackify; +exports.promisedCallback = promisedCallback; +exports.mapToKeysArray = mapToKeysArray; +exports.QueryParseError = QueryParseError; +exports.NotFoundError = NotFoundError; +exports.BuiltInError = BuiltInError; - var removed = {}; +},{"argsarray":39,"inherits":495,"pouchdb-collections":555,"pouchdb-utils":560}],558:[function(require,module,exports){ +arguments[4][524][0].apply(exports,arguments) +},{"dup":524,"pouchdb-binary-utils":553,"spark-md5":647}],559:[function(require,module,exports){ +arguments[4][510][0].apply(exports,arguments) +},{"dup":510,"lie":500}],560:[function(require,module,exports){ +arguments[4][511][0].apply(exports,arguments) +},{"argsarray":39,"dup":511,"events":491,"immediate":551,"inherits":495,"pouchdb-collections":555,"pouchdb-errors":556,"pouchdb-promise":559,"uuid":561}],561:[function(require,module,exports){ +arguments[4][512][0].apply(exports,arguments) +},{"./v1":564,"./v4":565,"dup":512}],562:[function(require,module,exports){ +arguments[4][513][0].apply(exports,arguments) +},{"dup":513}],563:[function(require,module,exports){ +arguments[4][514][0].apply(exports,arguments) +},{"dup":514}],564:[function(require,module,exports){ +arguments[4][515][0].apply(exports,arguments) +},{"./lib/bytesToUuid":562,"./lib/rng":563,"dup":515}],565:[function(require,module,exports){ +arguments[4][516][0].apply(exports,arguments) +},{"./lib/bytesToUuid":562,"./lib/rng":563,"dup":516}],566:[function(require,module,exports){ +'use strict'; - function removeAll(type) { // type is 'push' or 'pull' - return function (event, func) { - var isChange = event === 'change' && - (func === pullChange || func === pushChange); - var isDenied = event === 'denied' && - (func === pullDenied || func === pushDenied); - var isPaused = event === 'paused' && - (func === pullPaused || func === pushPaused); - var isActive = event === 'active' && - (func === pullActive || func === pushActive); +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - if (isChange || isDenied || isPaused || isActive) { - if (!(event in removed)) { - removed[event] = {}; - } - removed[event][type] = true; - if (Object.keys(removed[event]).length === 2) { - // both push and pull have asked to be removed - self.removeAllListeners(event); - } - } - }; - } +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbUtils = require('pouchdb-utils'); +var Checkpointer = _interopDefault(require('pouchdb-checkpointer')); +var generateReplicationId = _interopDefault(require('pouchdb-generate-replication-id')); +var pouchdbErrors = require('pouchdb-errors'); +var events = require('events'); +var inherits = _interopDefault(require('inherits')); - if (opts.live) { - this.push.on('complete', self.pull.cancel.bind(self.pull)); - this.pull.on('complete', self.push.cancel.bind(self.push)); - } +function isGenOne(rev) { + return /^1-/.test(rev); +} - function addOneListener(ee, event, listener) { - if (ee.listeners(event).indexOf(listener) == -1) { - ee.on(event, listener); - } - } +function fileHasChanged(localDoc, remoteDoc, filename) { + return !localDoc._attachments || + !localDoc._attachments[filename] || + localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest; +} - this.on('newListener', function (event) { - if (event === 'change') { - addOneListener(self.pull, 'change', pullChange); - addOneListener(self.push, 'change', pushChange); - } else if (event === 'denied') { - addOneListener(self.pull, 'denied', pullDenied); - addOneListener(self.push, 'denied', pushDenied); - } else if (event === 'active') { - addOneListener(self.pull, 'active', pullActive); - addOneListener(self.push, 'active', pushActive); - } else if (event === 'paused') { - addOneListener(self.pull, 'paused', pullPaused); - addOneListener(self.push, 'paused', pushPaused); - } - }); +function getDocAttachments(db, doc) { + var filenames = Object.keys(doc._attachments); + return Promise.all(filenames.map(function (filename) { + return db.getAttachment(doc._id, filename, {rev: doc._rev}); + })); +} - this.on('removeListener', function (event) { - if (event === 'change') { - self.pull.removeListener('change', pullChange); - self.push.removeListener('change', pushChange); - } else if (event === 'denied') { - self.pull.removeListener('denied', pullDenied); - self.push.removeListener('denied', pushDenied); - } else if (event === 'active') { - self.pull.removeListener('active', pullActive); - self.push.removeListener('active', pushActive); - } else if (event === 'paused') { - self.pull.removeListener('paused', pullPaused); - self.push.removeListener('paused', pushPaused); - } - }); +function getDocAttachmentsFromTargetOrSource(target, src, doc) { + var doCheckForLocalAttachments = pouchdbUtils.isRemote(src) && !pouchdbUtils.isRemote(target); + var filenames = Object.keys(doc._attachments); - this.pull.on('removeListener', removeAll('pull')); - this.push.on('removeListener', removeAll('push')); + if (!doCheckForLocalAttachments) { + return getDocAttachments(src, doc); + } - var promise = Promise.all([ - this.push, - this.pull - ]).then(function (resp) { - var out = { - push: resp[0], - pull: resp[1] - }; - self.emit('complete', out); - if (callback) { - callback(null, out); - } - self.removeAllListeners(); - return out; - }, function (err) { - self.cancel(); - if (callback) { - // if there's a callback, then the callback can receive - // the error event - callback(err); - } else { - // if there's no callback, then we're safe to emit an error - // event, which would otherwise throw an unhandled error - // due to 'error' being a special event in EventEmitters - self.emit('error', err); - } - self.removeAllListeners(); - if (callback) { - // no sense throwing if we're already emitting an 'error' event - throw err; + return target.get(doc._id).then(function (localDoc) { + return Promise.all(filenames.map(function (filename) { + if (fileHasChanged(localDoc, doc, filename)) { + return src.getAttachment(doc._id, filename); + } + + return target.getAttachment(localDoc._id, filename); + })); + }).catch(function (error) { + /* istanbul ignore if */ + if (error.status !== 404) { + throw error; } + + return getDocAttachments(src, doc); }); +} - this.then = function (success, err) { - return promise.then(success, err); - }; +function createBulkGetOpts(diffs) { + var requests = []; + Object.keys(diffs).forEach(function (id) { + var missingRevs = diffs[id].missing; + missingRevs.forEach(function (missingRev) { + requests.push({ + id: id, + rev: missingRev + }); + }); + }); - this.catch = function (err) { - return promise.catch(err); + return { + docs: requests, + revs: true, + latest: true }; } -Sync.prototype.cancel = function () { - if (!this.canceled) { - this.canceled = true; - this.push.cancel(); - this.pull.cancel(); - } -}; +// +// Fetch all the documents from the src as described in the "diffs", +// which is a mapping of docs IDs to revisions. If the state ever +// changes to "cancelled", then the returned promise will be rejected. +// Else it will be resolved with a list of fetched documents. +// +function getDocs(src, target, diffs, state) { + diffs = pouchdbUtils.clone(diffs); // we do not need to modify this -function replication(PouchDB) { - PouchDB.replicate = replicateWrapper; - PouchDB.sync = sync$1; + var resultDocs = [], + ok = true; - Object.defineProperty(PouchDB.prototype, 'replicate', { - get: function () { - var self = this; - if (typeof this.replicateMethods === 'undefined') { - this.replicateMethods = { - from: function (other, opts, callback) { - return self.constructor.replicate(other, self, opts, callback); - }, - to: function (other, opts, callback) { - return self.constructor.replicate(self, other, opts, callback); - } - }; - } - return this.replicateMethods; + function getAllDocs() { + + var bulkGetOpts = createBulkGetOpts(diffs); + + if (!bulkGetOpts.docs.length) { // optimization: skip empty requests + return; } - }); - PouchDB.prototype.sync = function (dbName, opts, callback) { - return this.constructor.sync(this, dbName, opts, callback); - }; -} + return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) { + /* istanbul ignore if */ + if (state.cancelled) { + throw new Error('cancelled'); + } + return Promise.all(bulkGetResponse.results.map(function (bulkGetInfo) { + return Promise.all(bulkGetInfo.docs.map(function (doc) { + var remoteDoc = doc.ok; -module.exports = replication; + if (doc.error) { + // when AUTO_COMPACTION is set, docs can be returned which look + // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"} + ok = false; + } -},{"events":491,"inherits":495,"pouchdb-checkpointer":519,"pouchdb-errors":529,"pouchdb-generate-replication-id":532,"pouchdb-promise":540,"pouchdb-utils":542}],540:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],541:[function(require,module,exports){ -'use strict'; + if (!remoteDoc || !remoteDoc._attachments) { + return remoteDoc; + } -Object.defineProperty(exports, '__esModule', { value: true }); + return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc) + .then(function (attachments) { + var filenames = Object.keys(remoteDoc._attachments); + attachments + .forEach(function (attachment, i) { + var att = remoteDoc._attachments[filenames[i]]; + delete att.stub; + delete att.length; + att.data = attachment; + }); -var pouchdbUtils = require('pouchdb-utils'); -var pouchdbCollate = require('pouchdb-collate'); + return remoteDoc; + }); + })); + })) -// this would just be "return doc[field]", but fields -// can be "deep" due to dot notation -function getFieldFromDoc(doc, parsedField) { - var value = doc; - for (var i = 0, len = parsedField.length; i < len; i++) { - var key = parsedField[i]; - value = value[key]; - if (!value) { - break; - } + .then(function (results) { + resultDocs = resultDocs.concat(pouchdbUtils.flatten(results).filter(Boolean)); + }); + }); } - return value; -} -function setFieldInDoc(doc, parsedField, value) { - for (var i = 0, len = parsedField.length; i < len-1; i++) { - var elem = parsedField[i]; - doc = doc[elem] = {}; + function hasAttachments(doc) { + return doc._attachments && Object.keys(doc._attachments).length > 0; } - doc[parsedField[len-1]] = value; -} -function compare(left, right) { - return left < right ? -1 : left > right ? 1 : 0; -} + function hasConflicts(doc) { + return doc._conflicts && doc._conflicts.length > 0; + } -// Converts a string in dot notation to an array of its components, with backslash escaping -function parseField(fieldName) { - // fields may be deep (e.g. "foo.bar.baz"), so parse - var fields = []; - var current = ''; - for (var i = 0, len = fieldName.length; i < len; i++) { - var ch = fieldName[i]; - if (ch === '.') { - if (i > 0 && fieldName[i - 1] === '\\') { // escaped delimiter - current = current.substring(0, current.length - 1) + '.'; - } else { // not escaped, so delimiter - fields.push(current); - current = ''; + function fetchRevisionOneDocs(ids) { + // Optimization: fetch gen-1 docs and attachments in + // a single request using _all_docs + return src.allDocs({ + keys: ids, + include_docs: true, + conflicts: true + }).then(function (res) { + if (state.cancelled) { + throw new Error('cancelled'); } - } else { // normal character - current += ch; + res.rows.forEach(function (row) { + if (row.deleted || !row.doc || !isGenOne(row.value.rev) || + hasAttachments(row.doc) || hasConflicts(row.doc)) { + // if any of these conditions apply, we need to fetch using get() + return; + } + + // strip _conflicts array to appease CSG (#5793) + /* istanbul ignore if */ + if (row.doc._conflicts) { + delete row.doc._conflicts; + } + + // the doc we got back from allDocs() is sufficient + resultDocs.push(row.doc); + delete diffs[row.id]; + }); + }); + } + + function getRevisionOneDocs() { + // filter out the generation 1 docs and get them + // leaving the non-generation one docs to be got otherwise + var ids = Object.keys(diffs).filter(function (id) { + var missing = diffs[id].missing; + return missing.length === 1 && isGenOne(missing[0]); + }); + if (ids.length > 0) { + return fetchRevisionOneDocs(ids); } } - fields.push(current); - return fields; -} -var combinationFields = ['$or', '$nor', '$not']; -function isCombinationalField(field) { - return combinationFields.indexOf(field) > -1; -} + function returnResult() { + return { ok:ok, docs:resultDocs }; + } -function getKey(obj) { - return Object.keys(obj)[0]; + return Promise.resolve() + .then(getRevisionOneDocs) + .then(getAllDocs) + .then(returnResult); } -function getValue(obj) { - return obj[getKey(obj)]; +var STARTING_BACK_OFF = 0; + +function backOff(opts, returnValue, error, callback) { + if (opts.retry === false) { + returnValue.emit('error', error); + returnValue.removeAllListeners(); + return; + } + if (typeof opts.back_off_function !== 'function') { + opts.back_off_function = pouchdbUtils.defaultBackOff; + } + returnValue.emit('requestError', error); + if (returnValue.state === 'active' || returnValue.state === 'pending') { + returnValue.emit('paused', error); + returnValue.state = 'stopped'; + var backOffSet = function backoffTimeSet() { + opts.current_back_off = STARTING_BACK_OFF; + }; + var removeBackOffSetter = function removeBackOffTimeSet() { + returnValue.removeListener('active', backOffSet); + }; + returnValue.once('paused', removeBackOffSetter); + returnValue.once('active', backOffSet); + } + + opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF; + opts.current_back_off = opts.back_off_function(opts.current_back_off); + setTimeout(callback, opts.current_back_off); } +function replicate(src, target, opts, returnValue, result) { + var batches = []; // list of batches to be processed + var currentBatch; // the batch currently being processed + var pendingBatch = { + seq: 0, + changes: [], + docs: [] + }; // next batch, not yet ready to be processed + var writingCheckpoint = false; // true while checkpoint is being written + var changesCompleted = false; // true when all changes received + var replicationCompleted = false; // true when replication has completed + var last_seq = 0; + var continuous = opts.continuous || opts.live || false; + var batch_size = opts.batch_size || 100; + var batches_limit = opts.batches_limit || 10; + var changesPending = false; // true while src.changes is running + var doc_ids = opts.doc_ids; + var selector = opts.selector; + var repId; + var checkpointer; + var changedDocs = []; + // Like couchdb, every replication gets a unique session id + var session = pouchdbUtils.uuid(); + var seq_interval = opts.seq_interval; + + result = result || { + ok: true, + start_time: new Date(), + docs_read: 0, + docs_written: 0, + doc_write_failures: 0, + errors: [] + }; -// flatten an array of selectors joined by an $and operator -function mergeAndedSelectors(selectors) { + var changesOpts = {}; + returnValue.ready(src, target); - // sort to ensure that e.g. if the user specified - // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into - // just {$gt: 'b'} - var res = {}; + function initCheckpointer() { + if (checkpointer) { + return Promise.resolve(); + } + return generateReplicationId(src, target, opts).then(function (res) { + repId = res; - selectors.forEach(function (selector) { - Object.keys(selector).forEach(function (field) { - var matcher = selector[field]; - if (typeof matcher !== 'object') { - matcher = {$eq: matcher}; + var checkpointOpts = {}; + if (opts.checkpoint === false) { + checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false }; + } else if (opts.checkpoint === 'source') { + checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false }; + } else if (opts.checkpoint === 'target') { + checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true }; + } else { + checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true }; + } + + checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts); + }); + } + + function writeDocs() { + changedDocs = []; + + if (currentBatch.docs.length === 0) { + return; + } + var docs = currentBatch.docs; + var bulkOpts = {timeout: opts.timeout}; + return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) { + /* istanbul ignore if */ + if (returnValue.cancelled) { + completeReplication(); + throw new Error('cancelled'); + } + + // `res` doesn't include full documents (which live in `docs`), so we create a map of + // (id -> error), and check for errors while iterating over `docs` + var errorsById = Object.create(null); + res.forEach(function (res) { + if (res.error) { + errorsById[res.id] = res; + } + }); + + var errorsNo = Object.keys(errorsById).length; + result.doc_write_failures += errorsNo; + result.docs_written += docs.length - errorsNo; + + docs.forEach(function (doc) { + var error = errorsById[doc._id]; + if (error) { + result.errors.push(error); + // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) + var errorName = (error.name || '').toLowerCase(); + if (errorName === 'unauthorized' || errorName === 'forbidden') { + returnValue.emit('denied', pouchdbUtils.clone(error)); + } else { + throw error; + } + } else { + changedDocs.push(doc); + } + }); + + }, function (err) { + result.doc_write_failures += docs.length; + throw err; + }); + } + + function finishBatch() { + if (currentBatch.error) { + throw new Error('There was a problem getting docs.'); + } + result.last_seq = last_seq = currentBatch.seq; + var outResult = pouchdbUtils.clone(result); + if (changedDocs.length) { + outResult.docs = changedDocs; + // Attach 'pending' property if server supports it (CouchDB 2.0+) + /* istanbul ignore if */ + if (typeof currentBatch.pending === 'number') { + outResult.pending = currentBatch.pending; + delete currentBatch.pending; + } + returnValue.emit('change', outResult); + } + writingCheckpoint = true; + return checkpointer.writeCheckpoint(currentBatch.seq, + session).then(function () { + writingCheckpoint = false; + /* istanbul ignore if */ + if (returnValue.cancelled) { + completeReplication(); + throw new Error('cancelled'); } + currentBatch = undefined; + getChanges(); + }).catch(function (err) { + onCheckpointError(err); + throw err; + }); + } - if (isCombinationalField(field)) { - if (matcher instanceof Array) { - res[field] = matcher.map(function (m) { - return mergeAndedSelectors([m]); - }); - } else { - res[field] = mergeAndedSelectors([matcher]); - } - } else { - var fieldMatchers = res[field] = res[field] || {}; - Object.keys(matcher).forEach(function (operator) { - var value = matcher[operator]; - - if (operator === '$gt' || operator === '$gte') { - return mergeGtGte(operator, value, fieldMatchers); - } else if (operator === '$lt' || operator === '$lte') { - return mergeLtLte(operator, value, fieldMatchers); - } else if (operator === '$ne') { - return mergeNe(value, fieldMatchers); - } else if (operator === '$eq') { - return mergeEq(value, fieldMatchers); - } - fieldMatchers[operator] = value; - }); + function getDiffs() { + var diff = {}; + currentBatch.changes.forEach(function (change) { + // Couchbase Sync Gateway emits these, but we can ignore them + /* istanbul ignore if */ + if (change.id === "_user/") { + return; } + diff[change.id] = change.changes.map(function (x) { + return x.rev; + }); }); - }); - - return res; -} - - + return target.revsDiff(diff).then(function (diffs) { + /* istanbul ignore if */ + if (returnValue.cancelled) { + completeReplication(); + throw new Error('cancelled'); + } + // currentBatch.diffs elements are deleted as the documents are written + currentBatch.diffs = diffs; + }); + } -// collapse logically equivalent gt/gte values -function mergeGtGte(operator, value, fieldMatchers) { - if (typeof fieldMatchers.$eq !== 'undefined') { - return; // do nothing + function getBatchDocs() { + return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) { + currentBatch.error = !got.ok; + got.docs.forEach(function (doc) { + delete currentBatch.diffs[doc._id]; + result.docs_read++; + currentBatch.docs.push(doc); + }); + }); } - if (typeof fieldMatchers.$gte !== 'undefined') { - if (operator === '$gte') { - if (value > fieldMatchers.$gte) { // more specificity - fieldMatchers.$gte = value; - } - } else { // operator === '$gt' - if (value >= fieldMatchers.$gte) { // more specificity - delete fieldMatchers.$gte; - fieldMatchers.$gt = value; - } + + function startNextBatch() { + if (returnValue.cancelled || currentBatch) { + return; } - } else if (typeof fieldMatchers.$gt !== 'undefined') { - if (operator === '$gte') { - if (value > fieldMatchers.$gt) { // more specificity - delete fieldMatchers.$gt; - fieldMatchers.$gte = value; - } - } else { // operator === '$gt' - if (value > fieldMatchers.$gt) { // more specificity - fieldMatchers.$gt = value; - } + if (batches.length === 0) { + processPendingBatch(true); + return; } - } else { - fieldMatchers[operator] = value; + currentBatch = batches.shift(); + getDiffs() + .then(getBatchDocs) + .then(writeDocs) + .then(finishBatch) + .then(startNextBatch) + .catch(function (err) { + abortReplication('batch processing terminated with error', err); + }); } -} -// collapse logically equivalent lt/lte values -function mergeLtLte(operator, value, fieldMatchers) { - if (typeof fieldMatchers.$eq !== 'undefined') { - return; // do nothing - } - if (typeof fieldMatchers.$lte !== 'undefined') { - if (operator === '$lte') { - if (value < fieldMatchers.$lte) { // more specificity - fieldMatchers.$lte = value; - } - } else { // operator === '$gt' - if (value <= fieldMatchers.$lte) { // more specificity - delete fieldMatchers.$lte; - fieldMatchers.$lt = value; + + function processPendingBatch(immediate) { + if (pendingBatch.changes.length === 0) { + if (batches.length === 0 && !currentBatch) { + if ((continuous && changesOpts.live) || changesCompleted) { + returnValue.state = 'pending'; + returnValue.emit('paused'); + } + if (changesCompleted) { + completeReplication(); + } } + return; } - } else if (typeof fieldMatchers.$lt !== 'undefined') { - if (operator === '$lte') { - if (value < fieldMatchers.$lt) { // more specificity - delete fieldMatchers.$lt; - fieldMatchers.$lte = value; - } - } else { // operator === '$gt' - if (value < fieldMatchers.$lt) { // more specificity - fieldMatchers.$lt = value; + if ( + immediate || + changesCompleted || + pendingBatch.changes.length >= batch_size + ) { + batches.push(pendingBatch); + pendingBatch = { + seq: 0, + changes: [], + docs: [] + }; + if (returnValue.state === 'pending' || returnValue.state === 'stopped') { + returnValue.state = 'active'; + returnValue.emit('active'); } + startNextBatch(); } - } else { - fieldMatchers[operator] = value; } -} -// combine $ne values into one array -function mergeNe(value, fieldMatchers) { - if ('$ne' in fieldMatchers) { - // there are many things this could "not" be - fieldMatchers.$ne.push(value); - } else { // doesn't exist yet - fieldMatchers.$ne = [value]; + + function abortReplication(reason, err) { + if (replicationCompleted) { + return; + } + if (!err.message) { + err.message = reason; + } + result.ok = false; + result.status = 'aborting'; + batches = []; + pendingBatch = { + seq: 0, + changes: [], + docs: [] + }; + completeReplication(err); } -} -// add $eq into the mix -function mergeEq(value, fieldMatchers) { - // these all have less specificity than the $eq - // TODO: check for user errors here - delete fieldMatchers.$gt; - delete fieldMatchers.$gte; - delete fieldMatchers.$lt; - delete fieldMatchers.$lte; - delete fieldMatchers.$ne; - fieldMatchers.$eq = value; -} + function completeReplication(fatalError) { + if (replicationCompleted) { + return; + } + /* istanbul ignore if */ + if (returnValue.cancelled) { + result.status = 'cancelled'; + if (writingCheckpoint) { + return; + } + } + result.status = result.status || 'complete'; + result.end_time = new Date(); + result.last_seq = last_seq; + replicationCompleted = true; -// -// normalize the selector -// -function massageSelector(input) { - var result = pouchdbUtils.clone(input); - var wasAnded = false; - if ('$and' in result) { - result = mergeAndedSelectors(result['$and']); - wasAnded = true; - } + if (fatalError) { + // need to extend the error because Firefox considers ".result" read-only + fatalError = pouchdbErrors.createError(fatalError); + fatalError.result = result; - ['$or', '$nor'].forEach(function (orOrNor) { - if (orOrNor in result) { - // message each individual selector - // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}} - result[orOrNor].forEach(function (subSelector) { - var fields = Object.keys(subSelector); - for (var i = 0; i < fields.length; i++) { - var field = fields[i]; - var matcher = subSelector[field]; - if (typeof matcher !== 'object' || matcher === null) { - subSelector[field] = {$eq: matcher}; - } - } - }); + // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) + var errorName = (fatalError.name || '').toLowerCase(); + if (errorName === 'unauthorized' || errorName === 'forbidden') { + returnValue.emit('error', fatalError); + returnValue.removeAllListeners(); + } else { + backOff(opts, returnValue, fatalError, function () { + replicate(src, target, opts, returnValue); + }); + } + } else { + returnValue.emit('complete', result); + returnValue.removeAllListeners(); } - }); - - if ('$not' in result) { - //This feels a little like forcing, but it will work for now, - //I would like to come back to this and make the merging of selectors a little more generic - result['$not'] = mergeAndedSelectors([result['$not']]); } - var fields = Object.keys(result); - for (var i = 0; i < fields.length; i++) { - var field = fields[i]; - var matcher = result[field]; + function onChange(change, pending, lastSeq) { + /* istanbul ignore if */ + if (returnValue.cancelled) { + return completeReplication(); + } + // Attach 'pending' property if server supports it (CouchDB 2.0+) + /* istanbul ignore if */ + if (typeof pending === 'number') { + pendingBatch.pending = pending; + } - if (typeof matcher !== 'object' || matcher === null) { - matcher = {$eq: matcher}; - } else if ('$ne' in matcher && !wasAnded) { - // I put these in an array, since there may be more than one - // but in the "mergeAnded" operation, I already take care of that - matcher.$ne = [matcher.$ne]; + var filter = pouchdbUtils.filterChange(opts)(change); + if (!filter) { + return; } - result[field] = matcher; + pendingBatch.seq = change.seq || lastSeq; + pendingBatch.changes.push(change); + processPendingBatch(batches.length === 0 && changesOpts.live); } - return result; -} -// create a comparator based on the sort object -function createFieldSorter(sort) { + function onChangesComplete(changes) { + changesPending = false; + /* istanbul ignore if */ + if (returnValue.cancelled) { + return completeReplication(); + } - function getFieldValuesAsArray(doc) { - return sort.map(function (sorting) { - var fieldName = getKey(sorting); - var parsedField = parseField(fieldName); - var docFieldValue = getFieldFromDoc(doc, parsedField); - return docFieldValue; - }); - } + // if no results were returned then we're done, + // else fetch more + if (changes.results.length > 0) { + changesOpts.since = changes.last_seq; + getChanges(); + processPendingBatch(true); + } else { - return function (aRow, bRow) { - var aFieldValues = getFieldValuesAsArray(aRow.doc); - var bFieldValues = getFieldValuesAsArray(bRow.doc); - var collation = pouchdbCollate.collate(aFieldValues, bFieldValues); - if (collation !== 0) { - return collation; + var complete = function () { + if (continuous) { + changesOpts.live = true; + getChanges(); + } else { + changesCompleted = true; + } + processPendingBatch(true); + }; + + // update the checkpoint so we start from the right seq next time + if (!currentBatch && changes.results.length === 0) { + writingCheckpoint = true; + checkpointer.writeCheckpoint(changes.last_seq, + session).then(function () { + writingCheckpoint = false; + result.last_seq = last_seq = changes.last_seq; + complete(); + }) + .catch(onCheckpointError); + } else { + complete(); + } } - // this is what mango seems to do - return compare(aRow.doc._id, bRow.doc._id); - }; -} + } -function filterInMemoryFields(rows, requestDef, inMemoryFields) { - rows = rows.filter(function (row) { - return rowFilter(row.doc, requestDef.selector, inMemoryFields); - }); - if (requestDef.sort) { - // in-memory sort - var fieldSorter = createFieldSorter(requestDef.sort); - rows = rows.sort(fieldSorter); - if (typeof requestDef.sort[0] !== 'string' && - getValue(requestDef.sort[0]) === 'desc') { - rows = rows.reverse(); + function onChangesError(err) { + changesPending = false; + /* istanbul ignore if */ + if (returnValue.cancelled) { + return completeReplication(); } + abortReplication('changes rejected', err); } - if ('limit' in requestDef || 'skip' in requestDef) { - // have to do the limit in-memory - var skip = requestDef.skip || 0; - var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip; - rows = rows.slice(skip, limit); - } - return rows; -} -function rowFilter(doc, selector, inMemoryFields) { - return inMemoryFields.every(function (field) { - var matcher = selector[field]; - var parsedField = parseField(field); - var docFieldValue = getFieldFromDoc(doc, parsedField); - if (isCombinationalField(field)) { - return matchCominationalSelector(field, matcher, doc); + function getChanges() { + if (!( + !changesPending && + !changesCompleted && + batches.length < batches_limit + )) { + return; + } + changesPending = true; + function abortChanges() { + changes.cancel(); + } + function removeListener() { + returnValue.removeListener('cancel', abortChanges); } - return matchSelector(matcher, doc, parsedField, docFieldValue); - }); -} + if (returnValue._changes) { // remove old changes() and listeners + returnValue.removeListener('cancel', returnValue._abortChanges); + returnValue._changes.cancel(); + } + returnValue.once('cancel', abortChanges); -function matchSelector(matcher, doc, parsedField, docFieldValue) { - if (!matcher) { - // no filtering necessary; this field is just needed for sorting - return true; - } + var changes = src.changes(changesOpts) + .on('change', onChange); + changes.then(removeListener, removeListener); + changes.then(onChangesComplete) + .catch(onChangesError); - return Object.keys(matcher).every(function (userOperator) { - var userValue = matcher[userOperator]; - return match(userOperator, doc, userValue, parsedField, docFieldValue); - }); -} + if (opts.retry) { + // save for later so we can cancel if necessary + returnValue._changes = changes; + returnValue._abortChanges = abortChanges; + } + } -function matchCominationalSelector(field, matcher, doc) { - if (field === '$or') { - return matcher.some(function (orMatchers) { - return rowFilter(doc, orMatchers, Object.keys(orMatchers)); + function startChanges() { + initCheckpointer().then(function () { + /* istanbul ignore if */ + if (returnValue.cancelled) { + completeReplication(); + return; + } + return checkpointer.getCheckpoint().then(function (checkpoint) { + last_seq = checkpoint; + changesOpts = { + since: last_seq, + limit: batch_size, + batch_size: batch_size, + style: 'all_docs', + doc_ids: doc_ids, + selector: selector, + return_docs: true // required so we know when we're done + }; + if (seq_interval !== false) { + changesOpts.seq_interval = seq_interval || batch_size; + } + if (opts.filter) { + if (typeof opts.filter !== 'string') { + // required for the client-side filter in onChange + changesOpts.include_docs = true; + } else { // ddoc filter + changesOpts.filter = opts.filter; + } + } + if ('heartbeat' in opts) { + changesOpts.heartbeat = opts.heartbeat; + } + if ('timeout' in opts) { + changesOpts.timeout = opts.timeout; + } + if (opts.query_params) { + changesOpts.query_params = opts.query_params; + } + if (opts.view) { + changesOpts.view = opts.view; + } + getChanges(); + }); + }).catch(function (err) { + abortReplication('getCheckpoint rejected with ', err); }); } - if (field === '$not') { - return !rowFilter(doc, matcher, Object.keys(matcher)); + /* istanbul ignore next */ + function onCheckpointError(err) { + writingCheckpoint = false; + abortReplication('writeCheckpoint completed with error', err); } - //`$nor` - return !matcher.find(function (orMatchers) { - return rowFilter(doc, orMatchers, Object.keys(orMatchers)); - }); + /* istanbul ignore if */ + if (returnValue.cancelled) { // cancelled immediately + completeReplication(); + return; + } -} + if (!returnValue._addedListeners) { + returnValue.once('cancel', completeReplication); -function match(userOperator, doc, userValue, parsedField, docFieldValue) { - if (!matchers[userOperator]) { - throw new Error('unknown operator "' + userOperator + - '" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' + - '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all'); + if (typeof opts.complete === 'function') { + returnValue.once('error', opts.complete); + returnValue.once('complete', function (result) { + opts.complete(null, result); + }); + } + returnValue._addedListeners = true; + } + + if (typeof opts.since === 'undefined') { + startChanges(); + } else { + initCheckpointer().then(function () { + writingCheckpoint = true; + return checkpointer.writeCheckpoint(opts.since, session); + }).then(function () { + writingCheckpoint = false; + /* istanbul ignore if */ + if (returnValue.cancelled) { + completeReplication(); + return; + } + last_seq = opts.since; + startChanges(); + }).catch(onCheckpointError); } - return matchers[userOperator](doc, userValue, parsedField, docFieldValue); } -function fieldExists(docFieldValue) { - return typeof docFieldValue !== 'undefined' && docFieldValue !== null; +// We create a basic promise so the caller can cancel the replication possibly +// before we have actually started listening to changes etc +inherits(Replication, events.EventEmitter); +function Replication() { + events.EventEmitter.call(this); + this.cancelled = false; + this.state = 'pending'; + var self = this; + var promise = new Promise(function (fulfill, reject) { + self.once('complete', fulfill); + self.once('error', reject); + }); + self.then = function (resolve, reject) { + return promise.then(resolve, reject); + }; + self.catch = function (reject) { + return promise.catch(reject); + }; + // As we allow error handling via "error" event as well, + // put a stub in here so that rejecting never throws UnhandledError. + self.catch(function () {}); } -function fieldIsNotUndefined(docFieldValue) { - return typeof docFieldValue !== 'undefined'; -} +Replication.prototype.cancel = function () { + this.cancelled = true; + this.state = 'cancelled'; + this.emit('cancel'); +}; -function modField(docFieldValue, userValue) { - var divisor = userValue[0]; - var mod = userValue[1]; - if (divisor === 0) { - throw new Error('Bad divisor, cannot divide by zero'); +Replication.prototype.ready = function (src, target) { + var self = this; + if (self._readyCalled) { + return; } + self._readyCalled = true; - if (parseInt(divisor, 10) !== divisor ) { - throw new Error('Divisor is not an integer'); + function onDestroy() { + self.cancel(); } - - if (parseInt(mod, 10) !== mod ) { - throw new Error('Modulus is not an integer'); + src.once('destroyed', onDestroy); + target.once('destroyed', onDestroy); + function cleanup() { + src.removeListener('destroyed', onDestroy); + target.removeListener('destroyed', onDestroy); } + self.once('complete', cleanup); +}; - if (parseInt(docFieldValue, 10) !== docFieldValue) { - return false; +function toPouch(db, opts) { + var PouchConstructor = opts.PouchConstructor; + if (typeof db === 'string') { + return new PouchConstructor(db, opts); + } else { + return db; } - - return docFieldValue % divisor === mod; -} - -function arrayContainsValue(docFieldValue, userValue) { - return userValue.some(function (val) { - if (docFieldValue instanceof Array) { - return docFieldValue.indexOf(val) > -1; - } - - return docFieldValue === val; - }); } -function arrayContainsAllValues(docFieldValue, userValue) { - return userValue.every(function (val) { - return docFieldValue.indexOf(val) > -1; - }); -} +function replicateWrapper(src, target, opts, callback) { -function arraySize(docFieldValue, userValue) { - return docFieldValue.length === userValue; -} + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + if (typeof opts === 'undefined') { + opts = {}; + } -function regexMatch(docFieldValue, userValue) { - var re = new RegExp(userValue); + if (opts.doc_ids && !Array.isArray(opts.doc_ids)) { + throw pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, + "`doc_ids` filter parameter is not a list."); + } - return re.test(docFieldValue); + opts.complete = callback; + opts = pouchdbUtils.clone(opts); + opts.continuous = opts.continuous || opts.live; + opts.retry = ('retry' in opts) ? opts.retry : false; + /*jshint validthis:true */ + opts.PouchConstructor = opts.PouchConstructor || this; + var replicateRet = new Replication(opts); + var srcPouch = toPouch(src, opts); + var targetPouch = toPouch(target, opts); + replicate(srcPouch, targetPouch, opts, replicateRet); + return replicateRet; } -function typeMatch(docFieldValue, userValue) { - - switch (userValue) { - case 'null': - return docFieldValue === null; - case 'boolean': - return typeof (docFieldValue) === 'boolean'; - case 'number': - return typeof (docFieldValue) === 'number'; - case 'string': - return typeof (docFieldValue) === 'string'; - case 'array': - return docFieldValue instanceof Array; - case 'object': - return ({}).toString.call(docFieldValue) === '[object Object]'; +inherits(Sync, events.EventEmitter); +function sync$1(src, target, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; } - - throw new Error(userValue + ' not supported as a type.' + - 'Please use one of object, string, array, number, boolean or null.'); - + if (typeof opts === 'undefined') { + opts = {}; + } + opts = pouchdbUtils.clone(opts); + /*jshint validthis:true */ + opts.PouchConstructor = opts.PouchConstructor || this; + src = toPouch(src, opts); + target = toPouch(target, opts); + return new Sync(src, target, opts, callback); } -var matchers = { +function Sync(src, target, opts, callback) { + var self = this; + this.canceled = false; - '$elemMatch': function (doc, userValue, parsedField, docFieldValue) { - if (!Array.isArray(docFieldValue)) { - return false; - } + var optsPush = opts.push ? pouchdbUtils.assign({}, opts, opts.push) : opts; + var optsPull = opts.pull ? pouchdbUtils.assign({}, opts, opts.pull) : opts; - if (docFieldValue.length === 0) { - return false; - } + this.push = replicateWrapper(src, target, optsPush); + this.pull = replicateWrapper(target, src, optsPull); - if (typeof docFieldValue[0] === 'object') { - return docFieldValue.some(function (val) { - return rowFilter(val, userValue, Object.keys(userValue)); - }); - } + this.pushPaused = true; + this.pullPaused = true; - return docFieldValue.some(function (val) { - return matchSelector(userValue, doc, parsedField, val); + function pullChange(change) { + self.emit('change', { + direction: 'pull', + change: change }); - }, - - '$allMatch': function (doc, userValue, parsedField, docFieldValue) { - if (!Array.isArray(docFieldValue)) { - return false; + } + function pushChange(change) { + self.emit('change', { + direction: 'push', + change: change + }); + } + function pushDenied(doc) { + self.emit('denied', { + direction: 'push', + doc: doc + }); + } + function pullDenied(doc) { + self.emit('denied', { + direction: 'pull', + doc: doc + }); + } + function pushPaused() { + self.pushPaused = true; + /* istanbul ignore if */ + if (self.pullPaused) { + self.emit('paused'); } - - /* istanbul ignore next */ - if (docFieldValue.length === 0) { - return false; + } + function pullPaused() { + self.pullPaused = true; + /* istanbul ignore if */ + if (self.pushPaused) { + self.emit('paused'); } - - if (typeof docFieldValue[0] === 'object') { - return docFieldValue.every(function (val) { - return rowFilter(val, userValue, Object.keys(userValue)); + } + function pushActive() { + self.pushPaused = false; + /* istanbul ignore if */ + if (self.pullPaused) { + self.emit('active', { + direction: 'push' }); } + } + function pullActive() { + self.pullPaused = false; + /* istanbul ignore if */ + if (self.pushPaused) { + self.emit('active', { + direction: 'pull' + }); + } + } - return docFieldValue.every(function (val) { - return matchSelector(userValue, doc, parsedField, val); - }); - }, - - '$eq': function (doc, userValue, parsedField, docFieldValue) { - return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) === 0; - }, - - '$gte': function (doc, userValue, parsedField, docFieldValue) { - return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) >= 0; - }, + var removed = {}; - '$gt': function (doc, userValue, parsedField, docFieldValue) { - return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) > 0; - }, + function removeAll(type) { // type is 'push' or 'pull' + return function (event, func) { + var isChange = event === 'change' && + (func === pullChange || func === pushChange); + var isDenied = event === 'denied' && + (func === pullDenied || func === pushDenied); + var isPaused = event === 'paused' && + (func === pullPaused || func === pushPaused); + var isActive = event === 'active' && + (func === pullActive || func === pushActive); - '$lte': function (doc, userValue, parsedField, docFieldValue) { - return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) <= 0; - }, + if (isChange || isDenied || isPaused || isActive) { + if (!(event in removed)) { + removed[event] = {}; + } + removed[event][type] = true; + if (Object.keys(removed[event]).length === 2) { + // both push and pull have asked to be removed + self.removeAllListeners(event); + } + } + }; + } - '$lt': function (doc, userValue, parsedField, docFieldValue) { - return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) < 0; - }, + if (opts.live) { + this.push.on('complete', self.pull.cancel.bind(self.pull)); + this.pull.on('complete', self.push.cancel.bind(self.push)); + } - '$exists': function (doc, userValue, parsedField, docFieldValue) { - //a field that is null is still considered to exist - if (userValue) { - return fieldIsNotUndefined(docFieldValue); + function addOneListener(ee, event, listener) { + if (ee.listeners(event).indexOf(listener) == -1) { + ee.on(event, listener); } + } - return !fieldIsNotUndefined(docFieldValue); - }, - - '$mod': function (doc, userValue, parsedField, docFieldValue) { - return fieldExists(docFieldValue) && modField(docFieldValue, userValue); - }, + this.on('newListener', function (event) { + if (event === 'change') { + addOneListener(self.pull, 'change', pullChange); + addOneListener(self.push, 'change', pushChange); + } else if (event === 'denied') { + addOneListener(self.pull, 'denied', pullDenied); + addOneListener(self.push, 'denied', pushDenied); + } else if (event === 'active') { + addOneListener(self.pull, 'active', pullActive); + addOneListener(self.push, 'active', pushActive); + } else if (event === 'paused') { + addOneListener(self.pull, 'paused', pullPaused); + addOneListener(self.push, 'paused', pushPaused); + } + }); - '$ne': function (doc, userValue, parsedField, docFieldValue) { - return userValue.every(function (neValue) { - return pouchdbCollate.collate(docFieldValue, neValue) !== 0; - }); - }, - '$in': function (doc, userValue, parsedField, docFieldValue) { - return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue); - }, + this.on('removeListener', function (event) { + if (event === 'change') { + self.pull.removeListener('change', pullChange); + self.push.removeListener('change', pushChange); + } else if (event === 'denied') { + self.pull.removeListener('denied', pullDenied); + self.push.removeListener('denied', pushDenied); + } else if (event === 'active') { + self.pull.removeListener('active', pullActive); + self.push.removeListener('active', pushActive); + } else if (event === 'paused') { + self.pull.removeListener('paused', pullPaused); + self.push.removeListener('paused', pushPaused); + } + }); - '$nin': function (doc, userValue, parsedField, docFieldValue) { - return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue); - }, + this.pull.on('removeListener', removeAll('pull')); + this.push.on('removeListener', removeAll('push')); - '$size': function (doc, userValue, parsedField, docFieldValue) { - return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue); - }, + var promise = Promise.all([ + this.push, + this.pull + ]).then(function (resp) { + var out = { + push: resp[0], + pull: resp[1] + }; + self.emit('complete', out); + if (callback) { + callback(null, out); + } + self.removeAllListeners(); + return out; + }, function (err) { + self.cancel(); + if (callback) { + // if there's a callback, then the callback can receive + // the error event + callback(err); + } else { + // if there's no callback, then we're safe to emit an error + // event, which would otherwise throw an unhandled error + // due to 'error' being a special event in EventEmitters + self.emit('error', err); + } + self.removeAllListeners(); + if (callback) { + // no sense throwing if we're already emitting an 'error' event + throw err; + } + }); - '$all': function (doc, userValue, parsedField, docFieldValue) { - return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue); - }, + this.then = function (success, err) { + return promise.then(success, err); + }; - '$regex': function (doc, userValue, parsedField, docFieldValue) { - return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue); - }, + this.catch = function (err) { + return promise.catch(err); + }; +} - '$type': function (doc, userValue, parsedField, docFieldValue) { - return typeMatch(docFieldValue, userValue); +Sync.prototype.cancel = function () { + if (!this.canceled) { + this.canceled = true; + this.push.cancel(); + this.pull.cancel(); } }; -// return true if the given doc matches the supplied selector -function matchesSelector(doc, selector) { - /* istanbul ignore if */ - if (typeof selector !== 'object') { - // match the CouchDB error message - throw new Error('Selector error: expected a JSON object'); - } +function replication(PouchDB) { + PouchDB.replicate = replicateWrapper; + PouchDB.sync = sync$1; - selector = massageSelector(selector); - var row = { - 'doc': doc - }; + Object.defineProperty(PouchDB.prototype, 'replicate', { + get: function () { + var self = this; + if (typeof this.replicateMethods === 'undefined') { + this.replicateMethods = { + from: function (other, opts, callback) { + return self.constructor.replicate(other, self, opts, callback); + }, + to: function (other, opts, callback) { + return self.constructor.replicate(self, other, opts, callback); + } + }; + } + return this.replicateMethods; + } + }); - var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector)); - return rowsMatched && rowsMatched.length === 1; + PouchDB.prototype.sync = function (dbName, opts, callback) { + return this.constructor.sync(this, dbName, opts, callback); + }; } -exports.massageSelector = massageSelector; -exports.matchesSelector = matchesSelector; -exports.filterInMemoryFields = filterInMemoryFields; -exports.createFieldSorter = createFieldSorter; -exports.rowFilter = rowFilter; -exports.isCombinationalField = isCombinationalField; -exports.getKey = getKey; -exports.getValue = getValue; -exports.getFieldFromDoc = getFieldFromDoc; -exports.setFieldInDoc = setFieldInDoc; -exports.compare = compare; -exports.parseField = parseField; +module.exports = replication; -},{"pouchdb-collate":521,"pouchdb-utils":542}],542:[function(require,module,exports){ +},{"events":491,"inherits":495,"pouchdb-checkpointer":569,"pouchdb-errors":572,"pouchdb-generate-replication-id":573,"pouchdb-promise":575,"pouchdb-utils":576}],567:[function(require,module,exports){ +arguments[4][501][0].apply(exports,arguments) +},{"dup":501}],568:[function(require,module,exports){ +arguments[4][507][0].apply(exports,arguments) +},{"dup":507}],569:[function(require,module,exports){ 'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); - function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var uuidV4 = _interopDefault(require('uuid')); var Promise = _interopDefault(require('pouchdb-promise')); -var getArguments = _interopDefault(require('argsarray')); -var pouchdbCollections = require('pouchdb-collections'); -var events = require('events'); -var inherits = _interopDefault(require('inherits')); -var immediate = _interopDefault(require('immediate')); -var pouchdbErrors = require('pouchdb-errors'); +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbCollate = require('pouchdb-collate'); + +var CHECKPOINT_VERSION = 1; +var REPLICATOR = "pouchdb"; +// This is an arbitrary number to limit the +// amount of replication history we save in the checkpoint. +// If we save too much, the checkpoing docs will become very big, +// if we save fewer, we'll run a greater risk of having to +// read all the changes from 0 when checkpoint PUTs fail +// CouchDB 2.0 has a more involved history pruning, +// but let's go for the simple version for now. +var CHECKPOINT_HISTORY_SIZE = 5; +var LOWEST_SEQ = 0; + +function updateCheckpoint(db, id, checkpoint, session, returnValue) { + return db.get(id).catch(function (err) { + if (err.status === 404) { + if (db.adapter === 'http' || db.adapter === 'https') { + pouchdbUtils.explainError( + 404, 'PouchDB is just checking if a remote checkpoint exists.' + ); + } + return { + session_id: session, + _id: id, + history: [], + replicator: REPLICATOR, + version: CHECKPOINT_VERSION + }; + } + throw err; + }).then(function (doc) { + if (returnValue.cancelled) { + return; + } + + // if the checkpoint has not changed, do not update + if (doc.last_seq === checkpoint) { + return; + } + + // Filter out current entry for this replication + doc.history = (doc.history || []).filter(function (item) { + return item.session_id !== session; + }); + + // Add the latest checkpoint to history + doc.history.unshift({ + last_seq: checkpoint, + session_id: session + }); + + // Just take the last pieces in history, to + // avoid really big checkpoint docs. + // see comment on history size above + doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE); -function isBinaryObject(object) { - return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) || - (typeof Blob !== 'undefined' && object instanceof Blob); -} + doc.version = CHECKPOINT_VERSION; + doc.replicator = REPLICATOR; -function cloneArrayBuffer(buff) { - if (typeof buff.slice === 'function') { - return buff.slice(0); - } - // IE10-11 slice() polyfill - var target = new ArrayBuffer(buff.byteLength); - var targetArray = new Uint8Array(target); - var sourceArray = new Uint8Array(buff); - targetArray.set(sourceArray); - return target; -} + doc.session_id = session; + doc.last_seq = checkpoint; -function cloneBinaryObject(object) { - if (object instanceof ArrayBuffer) { - return cloneArrayBuffer(object); - } - var size = object.size; - var type = object.type; - // Blob - if (typeof object.slice === 'function') { - return object.slice(0, size, type); - } - // PhantomJS slice() replacement - return object.webkitSlice(0, size, type); + return db.put(doc).catch(function (err) { + if (err.status === 409) { + // retry; someone is trying to write a checkpoint simultaneously + return updateCheckpoint(db, id, checkpoint, session, returnValue); + } + throw err; + }); + }); } -// most of this is borrowed from lodash.isPlainObject: -// https://github.com/fis-components/lodash.isplainobject/ -// blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js +function Checkpointer(src, target, id, returnValue, opts) { + this.src = src; + this.target = target; + this.id = id; + this.returnValue = returnValue; + this.opts = opts || {}; +} -var funcToString = Function.prototype.toString; -var objectCtorString = funcToString.call(Object); +Checkpointer.prototype.writeCheckpoint = function (checkpoint, session) { + var self = this; + return this.updateTarget(checkpoint, session).then(function () { + return self.updateSource(checkpoint, session); + }); +}; -function isPlainObject(value) { - var proto = Object.getPrototypeOf(value); - /* istanbul ignore if */ - if (proto === null) { // not sure when this happens, but I guess it can - return true; +Checkpointer.prototype.updateTarget = function (checkpoint, session) { + if (this.opts.writeTargetCheckpoint) { + return updateCheckpoint(this.target, this.id, checkpoint, + session, this.returnValue); + } else { + return Promise.resolve(true); } - var Ctor = proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); -} - -function clone(object) { - var newObject; - var i; - var len; +}; - if (!object || typeof object !== 'object') { - return object; +Checkpointer.prototype.updateSource = function (checkpoint, session) { + if (this.opts.writeSourceCheckpoint) { + var self = this; + return updateCheckpoint(this.src, this.id, checkpoint, + session, this.returnValue) + .catch(function (err) { + if (isForbiddenError(err)) { + self.opts.writeSourceCheckpoint = false; + return true; + } + throw err; + }); + } else { + return Promise.resolve(true); } +}; - if (Array.isArray(object)) { - newObject = []; - for (i = 0, len = object.length; i < len; i++) { - newObject[i] = clone(object[i]); +var comparisons = { + "undefined": function (targetDoc, sourceDoc) { + // This is the previous comparison function + if (pouchdbCollate.collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) { + return sourceDoc.last_seq; } - return newObject; + /* istanbul ignore next */ + return 0; + }, + "1": function (targetDoc, sourceDoc) { + // This is the comparison function ported from CouchDB + return compareReplicationLogs(sourceDoc, targetDoc).last_seq; } +}; - // special case: to avoid inconsistencies between IndexedDB - // and other backends, we automatically stringify Dates - if (object instanceof Date) { - return object.toISOString(); - } +Checkpointer.prototype.getCheckpoint = function () { + var self = this; - if (isBinaryObject(object)) { - return cloneBinaryObject(object); + if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) { + return self.src.get(self.id).then(function (sourceDoc) { + return sourceDoc.last_seq || LOWEST_SEQ; + }).catch(function (err) { + /* istanbul ignore if */ + if (err.status !== 404) { + throw err; + } + return LOWEST_SEQ; + }); } - if (!isPlainObject(object)) { - return object; // don't clone objects like Workers - } + return self.target.get(self.id).then(function (targetDoc) { + if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) { + return targetDoc.last_seq || LOWEST_SEQ; + } - newObject = {}; - for (i in object) { - /* istanbul ignore else */ - if (Object.prototype.hasOwnProperty.call(object, i)) { - var value = clone(object[i]); - if (typeof value !== 'undefined') { - newObject[i] = value; + return self.src.get(self.id).then(function (sourceDoc) { + // Since we can't migrate an old version doc to a new one + // (no session id), we just go with the lowest seq in this case + /* istanbul ignore if */ + if (targetDoc.version !== sourceDoc.version) { + return LOWEST_SEQ; } - } - } - return newObject; -} -function once(fun) { - var called = false; - return getArguments(function (args) { - /* istanbul ignore if */ - if (called) { - // this is a smoke test and should never actually happen - throw new Error('once called more than once'); - } else { - called = true; - fun.apply(this, args); - } - }); -} + var version; + if (targetDoc.version) { + version = targetDoc.version.toString(); + } else { + version = "undefined"; + } -function toPromise(func) { - //create the function we will be returning - return getArguments(function (args) { - // Clone arguments - args = clone(args); - var self = this; - // if the last argument is a function, assume its a callback - var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false; - var promise = new Promise(function (fulfill, reject) { - var resp; - try { - var callback = once(function (err, mesg) { - if (err) { - reject(err); - } else { - fulfill(mesg); + if (version in comparisons) { + return comparisons[version](targetDoc, sourceDoc); + } + /* istanbul ignore next */ + return LOWEST_SEQ; + }, function (err) { + if (err.status === 404 && targetDoc.last_seq) { + return self.src.put({ + _id: self.id, + last_seq: LOWEST_SEQ + }).then(function () { + return LOWEST_SEQ; + }, function (err) { + if (isForbiddenError(err)) { + self.opts.writeSourceCheckpoint = false; + return targetDoc.last_seq; } + /* istanbul ignore next */ + return LOWEST_SEQ; }); - // create a callback for this invocation - // apply the function in the orig context - args.push(callback); - resp = func.apply(self, args); - if (resp && typeof resp.then === 'function') { - fulfill(resp); - } - } catch (e) { - reject(e); } + throw err; }); - // if there is a callback, call it back - if (usedCB) { - promise.then(function (result) { - usedCB(null, result); - }, usedCB); + }).catch(function (err) { + if (err.status !== 404) { + throw err; } - return promise; + return LOWEST_SEQ; }); -} - -function logApiCall(self, name, args) { - /* istanbul ignore if */ - if (self.constructor.listeners('debug').length) { - var logArgs = ['api', self.name, name]; - for (var i = 0; i < args.length - 1; i++) { - logArgs.push(args[i]); - } - self.constructor.emit('debug', logArgs); +}; +// This checkpoint comparison is ported from CouchDBs source +// they come from here: +// https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906 - // override the callback itself to log the response - var origCallback = args[args.length - 1]; - args[args.length - 1] = function (err, res) { - var responseArgs = ['api', self.name, name]; - responseArgs = responseArgs.concat( - err ? ['error', err] : ['success', res] - ); - self.constructor.emit('debug', responseArgs); - origCallback(err, res); +function compareReplicationLogs(srcDoc, tgtDoc) { + if (srcDoc.session_id === tgtDoc.session_id) { + return { + last_seq: srcDoc.last_seq, + history: srcDoc.history }; } -} -function adapterFun(name, callback) { - return toPromise(getArguments(function (args) { - if (this._closed) { - return Promise.reject(new Error('database is closed')); - } - if (this._destroyed) { - return Promise.reject(new Error('database is destroyed')); - } - var self = this; - logApiCall(self, name, args); - if (!this.taskqueue.isReady) { - return new Promise(function (fulfill, reject) { - self.taskqueue.addTask(function (failed) { - if (failed) { - reject(failed); - } else { - fulfill(self[name].apply(self, args)); - } - }); - }); - } - return callback.apply(this, args); - })); + return compareReplicationHistory(srcDoc.history, tgtDoc.history); } -// like underscore/lodash _.pick() -function pick(obj, arr) { - var res = {}; - for (var i = 0, len = arr.length; i < len; i++) { - var prop = arr[i]; - if (prop in obj) { - res[prop] = obj[prop]; - } +function compareReplicationHistory(sourceHistory, targetHistory) { + // the erlang loop via function arguments is not so easy to repeat in JS + // therefore, doing this as recursion + var S = sourceHistory[0]; + var sourceRest = sourceHistory.slice(1); + var T = targetHistory[0]; + var targetRest = targetHistory.slice(1); + + if (!S || targetHistory.length === 0) { + return { + last_seq: LOWEST_SEQ, + history: [] + }; } - return res; -} -// Most browsers throttle concurrent requests at 6, so it's silly -// to shim _bulk_get by trying to launch potentially hundreds of requests -// and then letting the majority time out. We can handle this ourselves. -var MAX_NUM_CONCURRENT_REQUESTS = 6; + var sourceId = S.session_id; + /* istanbul ignore if */ + if (hasSessionId(sourceId, targetHistory)) { + return { + last_seq: S.last_seq, + history: sourceHistory + }; + } -function identityFunction(x) { - return x; -} + var targetId = T.session_id; + if (hasSessionId(targetId, sourceRest)) { + return { + last_seq: T.last_seq, + history: targetRest + }; + } -function formatResultForOpenRevsGet(result) { - return [{ - ok: result - }]; + return compareReplicationHistory(sourceRest, targetRest); } -// shim for P/CouchDB adapters that don't directly implement _bulk_get -function bulkGet(db, opts, callback) { - var requests = opts.docs; - - // consolidate into one request per doc if possible - var requestsById = new pouchdbCollections.Map(); - requests.forEach(function (request) { - if (requestsById.has(request.id)) { - requestsById.get(request.id).push(request); - } else { - requestsById.set(request.id, [request]); - } - }); - - var numDocs = requestsById.size; - var numDone = 0; - var perDocResults = new Array(numDocs); - - function collapseResultsAndFinish() { - var results = []; - perDocResults.forEach(function (res) { - res.docs.forEach(function (info) { - results.push({ - id: res.id, - docs: [info] - }); - }); - }); - callback(null, {results: results}); - } +function hasSessionId(sessionId, history) { + var props = history[0]; + var rest = history.slice(1); - function checkDone() { - if (++numDone === numDocs) { - collapseResultsAndFinish(); - } + if (!sessionId || history.length === 0) { + return false; } - function gotResult(docIndex, id, docs) { - perDocResults[docIndex] = {id: id, docs: docs}; - checkDone(); + if (sessionId === props.session_id) { + return true; } - var allRequests = []; - requestsById.forEach(function (value, key) { - allRequests.push(key); - }); + return hasSessionId(sessionId, rest); +} - var i = 0; +function isForbiddenError(err) { + return typeof err.status === 'number' && Math.floor(err.status / 100) === 4; +} - function nextBatch() { +module.exports = Checkpointer; - if (i >= allRequests.length) { - return; - } +},{"pouchdb-collate":570,"pouchdb-promise":575,"pouchdb-utils":576}],570:[function(require,module,exports){ +arguments[4][554][0].apply(exports,arguments) +},{"dup":554}],571:[function(require,module,exports){ +arguments[4][508][0].apply(exports,arguments) +},{"dup":508}],572:[function(require,module,exports){ +arguments[4][509][0].apply(exports,arguments) +},{"dup":509,"inherits":495}],573:[function(require,module,exports){ +'use strict'; - var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length); - var batch = allRequests.slice(i, upTo); - processBatch(batch, i); - i += batch.length; - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - function processBatch(batch, offset) { - batch.forEach(function (docId, j) { - var docIdx = offset + j; - var docRequests = requestsById.get(docId); +var Promise = _interopDefault(require('pouchdb-promise')); +var pouchdbMd5 = require('pouchdb-md5'); +var pouchdbCollate = require('pouchdb-collate'); - // just use the first request as the "template" - // TODO: The _bulk_get API allows for more subtle use cases than this, - // but for now it is unlikely that there will be a mix of different - // "atts_since" or "attachments" in the same request, since it's just - // replicate.js that is using this for the moment. - // Also, atts_since is aspirational, since we don't support it yet. - var docOpts = pick(docRequests[0], ['atts_since', 'attachments']); - docOpts.open_revs = docRequests.map(function (request) { - // rev is optional, open_revs disallowed - return request.rev; - }); +function sortObjectPropertiesByKey(queryParams) { + return Object.keys(queryParams).sort(pouchdbCollate.collate).reduce(function (result, key) { + result[key] = queryParams[key]; + return result; + }, {}); +} - // remove falsey / undefined revisions - docOpts.open_revs = docOpts.open_revs.filter(identityFunction); +// Generate a unique id particular to this replication. +// Not guaranteed to align perfectly with CouchDB's rep ids. +function generateReplicationId(src, target, opts) { + var docIds = opts.doc_ids ? opts.doc_ids.sort(pouchdbCollate.collate) : ''; + var filterFun = opts.filter ? opts.filter.toString() : ''; + var queryParams = ''; + var filterViewName = ''; + var selector = ''; - var formatResult = identityFunction; + // possibility for checkpoints to be lost here as behaviour of + // JSON.stringify is not stable (see #6226) + /* istanbul ignore if */ + if (opts.selector) { + selector = JSON.stringify(opts.selector); + } - if (docOpts.open_revs.length === 0) { - delete docOpts.open_revs; + if (opts.filter && opts.query_params) { + queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params)); + } - // when fetching only the "winning" leaf, - // transform the result so it looks like an open_revs - // request - formatResult = formatResultForOpenRevsGet; - } + if (opts.filter && opts.filter === '_view') { + filterViewName = opts.view.toString(); + } - // globally-supplied options - ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) { - if (param in opts) { - docOpts[param] = opts[param]; - } - }); - db.get(docId, docOpts, function (err, res) { - var result; - /* istanbul ignore if */ - if (err) { - result = [{error: err}]; - } else { - result = formatResult(res); - } - gotResult(docIdx, docId, result); - nextBatch(); - }); + return Promise.all([src.id(), target.id()]).then(function (res) { + var queryData = res[0] + res[1] + filterFun + filterViewName + + queryParams + docIds + selector; + return new Promise(function (resolve) { + pouchdbMd5.binaryMd5(queryData, resolve); }); - } + }).then(function (md5sum) { + // can't use straight-up md5 alphabet, because + // the char '/' is interpreted as being for attachments, + // and + is also not url-safe + md5sum = md5sum.replace(/\//g, '.').replace(/\+/g, '_'); + return '_local/' + md5sum; + }); +} - nextBatch(); +module.exports = generateReplicationId; -} +},{"pouchdb-collate":570,"pouchdb-md5":574,"pouchdb-promise":575}],574:[function(require,module,exports){ +arguments[4][524][0].apply(exports,arguments) +},{"dup":524,"pouchdb-binary-utils":568,"spark-md5":647}],575:[function(require,module,exports){ +arguments[4][510][0].apply(exports,arguments) +},{"dup":510,"lie":500}],576:[function(require,module,exports){ +arguments[4][511][0].apply(exports,arguments) +},{"argsarray":39,"dup":511,"events":491,"immediate":567,"inherits":495,"pouchdb-collections":571,"pouchdb-errors":572,"pouchdb-promise":575,"uuid":577}],577:[function(require,module,exports){ +arguments[4][512][0].apply(exports,arguments) +},{"./v1":580,"./v4":581,"dup":512}],578:[function(require,module,exports){ +arguments[4][513][0].apply(exports,arguments) +},{"dup":513}],579:[function(require,module,exports){ +arguments[4][514][0].apply(exports,arguments) +},{"dup":514}],580:[function(require,module,exports){ +arguments[4][515][0].apply(exports,arguments) +},{"./lib/bytesToUuid":578,"./lib/rng":579,"dup":515}],581:[function(require,module,exports){ +arguments[4][516][0].apply(exports,arguments) +},{"./lib/bytesToUuid":578,"./lib/rng":579,"dup":516}],582:[function(require,module,exports){ +'use strict'; -function isChromeApp() { - return (typeof chrome !== "undefined" && - typeof chrome.storage !== "undefined" && - typeof chrome.storage.local !== "undefined"); -} +Object.defineProperty(exports, '__esModule', { value: true }); -var hasLocal; +var pouchdbUtils = require('pouchdb-utils'); +var pouchdbCollate = require('pouchdb-collate'); -if (isChromeApp()) { - hasLocal = false; -} else { - try { - localStorage.setItem('_pouch_check_localstorage', 1); - hasLocal = !!localStorage.getItem('_pouch_check_localstorage'); - } catch (e) { - hasLocal = false; +// this would just be "return doc[field]", but fields +// can be "deep" due to dot notation +function getFieldFromDoc(doc, parsedField) { + var value = doc; + for (var i = 0, len = parsedField.length; i < len; i++) { + var key = parsedField[i]; + value = value[key]; + if (!value) { + break; + } } + return value; } -function hasLocalStorage() { - return hasLocal; +function setFieldInDoc(doc, parsedField, value) { + for (var i = 0, len = parsedField.length; i < len-1; i++) { + var elem = parsedField[i]; + doc = doc[elem] = {}; + } + doc[parsedField[len-1]] = value; } -// Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We -// avoid using process.nextTick() directly because the polyfill is very large and we don't -// need all of it (see: https://github.com/defunctzombie/node-process). -// "immediate" 3.0.8 is used by lie, and it's a smaller version of the latest "immediate" -// package, so it's the one we use. -// When we use nextTick() in our codebase, we only care about not releasing Zalgo -// (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). -// Microtask vs macrotask doesn't matter to us. So we're free to use the fastest -// (least latency) option, which is "immediate" due to use of microtasks. -// All of our nextTicks are isolated to this one function so we can easily swap out one -// implementation for another. - -inherits(Changes, events.EventEmitter); +function compare(left, right) { + return left < right ? -1 : left > right ? 1 : 0; +} -/* istanbul ignore next */ -function attachBrowserEvents(self) { - if (isChromeApp()) { - chrome.storage.onChanged.addListener(function (e) { - // make sure it's event addressed to us - if (e.db_name != null) { - //object only has oldValue, newValue members - self.emit(e.dbName.newValue); +// Converts a string in dot notation to an array of its components, with backslash escaping +function parseField(fieldName) { + // fields may be deep (e.g. "foo.bar.baz"), so parse + var fields = []; + var current = ''; + for (var i = 0, len = fieldName.length; i < len; i++) { + var ch = fieldName[i]; + if (ch === '.') { + if (i > 0 && fieldName[i - 1] === '\\') { // escaped delimiter + current = current.substring(0, current.length - 1) + '.'; + } else { // not escaped, so delimiter + fields.push(current); + current = ''; } - }); - } else if (hasLocalStorage()) { - if (typeof addEventListener !== 'undefined') { - addEventListener("storage", function (e) { - self.emit(e.key); - }); - } else { // old IE - window.attachEvent("storage", function (e) { - self.emit(e.key); - }); + } else { // normal character + current += ch; } } + fields.push(current); + return fields; } -function Changes() { - events.EventEmitter.call(this); - this._listeners = {}; +var combinationFields = ['$or', '$nor', '$not']; +function isCombinationalField(field) { + return combinationFields.indexOf(field) > -1; +} - attachBrowserEvents(this); +function getKey(obj) { + return Object.keys(obj)[0]; } -Changes.prototype.addListener = function (dbName, id, db, opts) { - /* istanbul ignore if */ - if (this._listeners[id]) { - return; - } - var self = this; - var inprogress = false; - function eventFunction() { - /* istanbul ignore if */ - if (!self._listeners[id]) { - return; - } - if (inprogress) { - inprogress = 'waiting'; - return; - } - inprogress = true; - var changesOpts = pick(opts, [ - 'style', 'include_docs', 'attachments', 'conflicts', 'filter', - 'doc_ids', 'view', 'since', 'query_params', 'binary' - ]); - /* istanbul ignore next */ - function onError() { - inprogress = false; - } +function getValue(obj) { + return obj[getKey(obj)]; +} - db.changes(changesOpts).on('change', function (c) { - if (c.seq > opts.since && !opts.cancelled) { - opts.since = c.seq; - opts.onChange(c); - } - }).on('complete', function () { - if (inprogress === 'waiting') { - immediate(eventFunction); + +// flatten an array of selectors joined by an $and operator +function mergeAndedSelectors(selectors) { + + // sort to ensure that e.g. if the user specified + // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into + // just {$gt: 'b'} + var res = {}; + + selectors.forEach(function (selector) { + Object.keys(selector).forEach(function (field) { + var matcher = selector[field]; + if (typeof matcher !== 'object') { + matcher = {$eq: matcher}; } - inprogress = false; - }).on('error', onError); - } - this._listeners[id] = eventFunction; - this.on(dbName, eventFunction); -}; -Changes.prototype.removeListener = function (dbName, id) { - /* istanbul ignore if */ - if (!(id in this._listeners)) { - return; - } - events.EventEmitter.prototype.removeListener.call(this, dbName, - this._listeners[id]); - delete this._listeners[id]; -}; + if (isCombinationalField(field)) { + if (matcher instanceof Array) { + res[field] = matcher.map(function (m) { + return mergeAndedSelectors([m]); + }); + } else { + res[field] = mergeAndedSelectors([matcher]); + } + } else { + var fieldMatchers = res[field] = res[field] || {}; + Object.keys(matcher).forEach(function (operator) { + var value = matcher[operator]; + + if (operator === '$gt' || operator === '$gte') { + return mergeGtGte(operator, value, fieldMatchers); + } else if (operator === '$lt' || operator === '$lte') { + return mergeLtLte(operator, value, fieldMatchers); + } else if (operator === '$ne') { + return mergeNe(value, fieldMatchers); + } else if (operator === '$eq') { + return mergeEq(value, fieldMatchers); + } + fieldMatchers[operator] = value; + }); + } + }); + }); + return res; +} -/* istanbul ignore next */ -Changes.prototype.notifyLocalWindows = function (dbName) { - //do a useless change on a storage thing - //in order to get other windows's listeners to activate - if (isChromeApp()) { - chrome.storage.local.set({dbName: dbName}); - } else if (hasLocalStorage()) { - localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a"; - } -}; -Changes.prototype.notify = function (dbName) { - this.emit(dbName); - this.notifyLocalWindows(dbName); -}; -function guardedConsole(method) { - /* istanbul ignore else */ - if (typeof console !== 'undefined' && typeof console[method] === 'function') { - var args = Array.prototype.slice.call(arguments, 1); - console[method].apply(console, args); +// collapse logically equivalent gt/gte values +function mergeGtGte(operator, value, fieldMatchers) { + if (typeof fieldMatchers.$eq !== 'undefined') { + return; // do nothing + } + if (typeof fieldMatchers.$gte !== 'undefined') { + if (operator === '$gte') { + if (value > fieldMatchers.$gte) { // more specificity + fieldMatchers.$gte = value; + } + } else { // operator === '$gt' + if (value >= fieldMatchers.$gte) { // more specificity + delete fieldMatchers.$gte; + fieldMatchers.$gt = value; + } + } + } else if (typeof fieldMatchers.$gt !== 'undefined') { + if (operator === '$gte') { + if (value > fieldMatchers.$gt) { // more specificity + delete fieldMatchers.$gt; + fieldMatchers.$gte = value; + } + } else { // operator === '$gt' + if (value > fieldMatchers.$gt) { // more specificity + fieldMatchers.$gt = value; + } + } + } else { + fieldMatchers[operator] = value; } } -function randomNumber(min, max) { - var maxTimeout = 600000; // Hard-coded default of 10 minutes - min = parseInt(min, 10) || 0; - max = parseInt(max, 10); - if (max !== max || max <= min) { - max = (min || 1) << 1; //doubling - } else { - max = max + 1; +// collapse logically equivalent lt/lte values +function mergeLtLte(operator, value, fieldMatchers) { + if (typeof fieldMatchers.$eq !== 'undefined') { + return; // do nothing } - // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout - if (max > maxTimeout) { - min = maxTimeout >> 1; // divide by two - max = maxTimeout; + if (typeof fieldMatchers.$lte !== 'undefined') { + if (operator === '$lte') { + if (value < fieldMatchers.$lte) { // more specificity + fieldMatchers.$lte = value; + } + } else { // operator === '$gt' + if (value <= fieldMatchers.$lte) { // more specificity + delete fieldMatchers.$lte; + fieldMatchers.$lt = value; + } + } + } else if (typeof fieldMatchers.$lt !== 'undefined') { + if (operator === '$lte') { + if (value < fieldMatchers.$lt) { // more specificity + delete fieldMatchers.$lt; + fieldMatchers.$lte = value; + } + } else { // operator === '$gt' + if (value < fieldMatchers.$lt) { // more specificity + fieldMatchers.$lt = value; + } + } + } else { + fieldMatchers[operator] = value; } - var ratio = Math.random(); - var range = max - min; - - return ~~(range * ratio + min); // ~~ coerces to an int, but fast. } -function defaultBackOff(min) { - var max = 0; - if (!min) { - max = 2000; +// combine $ne values into one array +function mergeNe(value, fieldMatchers) { + if ('$ne' in fieldMatchers) { + // there are many things this could "not" be + fieldMatchers.$ne.push(value); + } else { // doesn't exist yet + fieldMatchers.$ne = [value]; } - return randomNumber(min, max); } -// designed to give info to browser users, who are disturbed -// when they see http errors in the console -function explainError(status, str) { - guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str); +// add $eq into the mix +function mergeEq(value, fieldMatchers) { + // these all have less specificity than the $eq + // TODO: check for user errors here + delete fieldMatchers.$gt; + delete fieldMatchers.$gte; + delete fieldMatchers.$lt; + delete fieldMatchers.$lte; + delete fieldMatchers.$ne; + fieldMatchers.$eq = value; } -var assign; -{ - if (typeof Object.assign === 'function') { - assign = Object.assign; - } else { - // lite Object.assign polyfill based on - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - assign = function (target) { - var to = Object(target); - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; +// +// normalize the selector +// +function massageSelector(input) { + var result = pouchdbUtils.clone(input); + var wasAnded = false; + if ('$and' in result) { + result = mergeAndedSelectors(result['$and']); + wasAnded = true; + } - if (nextSource != null) { // Skip over if undefined or null - for (var nextKey in nextSource) { - // Avoid bugs when hasOwnProperty is shadowed - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - to[nextKey] = nextSource[nextKey]; - } + ['$or', '$nor'].forEach(function (orOrNor) { + if (orOrNor in result) { + // message each individual selector + // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}} + result[orOrNor].forEach(function (subSelector) { + var fields = Object.keys(subSelector); + for (var i = 0; i < fields.length; i++) { + var field = fields[i]; + var matcher = subSelector[field]; + if (typeof matcher !== 'object' || matcher === null) { + subSelector[field] = {$eq: matcher}; } } - } - return to; - }; + }); + } + }); + + if ('$not' in result) { + //This feels a little like forcing, but it will work for now, + //I would like to come back to this and make the merging of selectors a little more generic + result['$not'] = mergeAndedSelectors([result['$not']]); } -} -var assign$1 = assign; + var fields = Object.keys(result); -function tryFilter(filter, doc, req) { - try { - return !filter(doc, req); - } catch (err) { - var msg = 'Filter function threw: ' + err.toString(); - return pouchdbErrors.createError(pouchdbErrors.BAD_REQUEST, msg); + for (var i = 0; i < fields.length; i++) { + var field = fields[i]; + var matcher = result[field]; + + if (typeof matcher !== 'object' || matcher === null) { + matcher = {$eq: matcher}; + } else if ('$ne' in matcher && !wasAnded) { + // I put these in an array, since there may be more than one + // but in the "mergeAnded" operation, I already take care of that + matcher.$ne = [matcher.$ne]; + } + result[field] = matcher; } + + return result; } -function filterChange(opts) { - var req = {}; - var hasFilter = opts.filter && typeof opts.filter === 'function'; - req.query = opts.query_params; +// create a comparator based on the sort object +function createFieldSorter(sort) { - return function filter(change) { - if (!change.doc) { - // CSG sends events on the changes feed that don't have documents, - // this hack makes a whole lot of existing code robust. - change.doc = {}; + function getFieldValuesAsArray(doc) { + return sort.map(function (sorting) { + var fieldName = getKey(sorting); + var parsedField = parseField(fieldName); + var docFieldValue = getFieldFromDoc(doc, parsedField); + return docFieldValue; + }); + } + + return function (aRow, bRow) { + var aFieldValues = getFieldValuesAsArray(aRow.doc); + var bFieldValues = getFieldValuesAsArray(bRow.doc); + var collation = pouchdbCollate.collate(aFieldValues, bFieldValues); + if (collation !== 0) { + return collation; } + // this is what mango seems to do + return compare(aRow.doc._id, bRow.doc._id); + }; +} - var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req); +function filterInMemoryFields(rows, requestDef, inMemoryFields) { + rows = rows.filter(function (row) { + return rowFilter(row.doc, requestDef.selector, inMemoryFields); + }); - if (typeof filterReturn === 'object') { - return filterReturn; + if (requestDef.sort) { + // in-memory sort + var fieldSorter = createFieldSorter(requestDef.sort); + rows = rows.sort(fieldSorter); + if (typeof requestDef.sort[0] !== 'string' && + getValue(requestDef.sort[0]) === 'desc') { + rows = rows.reverse(); } + } - if (filterReturn) { - return false; - } + if ('limit' in requestDef || 'skip' in requestDef) { + // have to do the limit in-memory + var skip = requestDef.skip || 0; + var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip; + rows = rows.slice(skip, limit); + } + return rows; +} - if (!opts.include_docs) { - delete change.doc; - } else if (!opts.attachments) { - for (var att in change.doc._attachments) { - /* istanbul ignore else */ - if (change.doc._attachments.hasOwnProperty(att)) { - change.doc._attachments[att].stub = true; - } - } +function rowFilter(doc, selector, inMemoryFields) { + return inMemoryFields.every(function (field) { + var matcher = selector[field]; + var parsedField = parseField(field); + var docFieldValue = getFieldFromDoc(doc, parsedField); + if (isCombinationalField(field)) { + return matchCominationalSelector(field, matcher, doc); } - return true; - }; + + return matchSelector(matcher, doc, parsedField, docFieldValue); + }); } -function flatten(arrs) { - var res = []; - for (var i = 0, len = arrs.length; i < len; i++) { - res = res.concat(arrs[i]); +function matchSelector(matcher, doc, parsedField, docFieldValue) { + if (!matcher) { + // no filtering necessary; this field is just needed for sorting + return true; } - return res; + + return Object.keys(matcher).every(function (userOperator) { + var userValue = matcher[userOperator]; + return match(userOperator, doc, userValue, parsedField, docFieldValue); + }); } -// shim for Function.prototype.name, -// for browsers that don't support it like IE +function matchCominationalSelector(field, matcher, doc) { -/* istanbul ignore next */ -function f() {} + if (field === '$or') { + return matcher.some(function (orMatchers) { + return rowFilter(doc, orMatchers, Object.keys(orMatchers)); + }); + } -var hasName = f.name; -var res; + if (field === '$not') { + return !rowFilter(doc, matcher, Object.keys(matcher)); + } -// We dont run coverage in IE -/* istanbul ignore else */ -if (hasName) { - res = function (fun) { - return fun.name; - }; -} else { - res = function (fun) { - return fun.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; - }; -} + //`$nor` + return !matcher.find(function (orMatchers) { + return rowFilter(doc, orMatchers, Object.keys(orMatchers)); + }); -var res$1 = res; +} -// Determine id an ID is valid -// - invalid IDs begin with an underescore that does not begin '_design' or -// '_local' -// - any other string value is a valid id -// Returns the specific error object for each case -function invalidIdError(id) { - var err; - if (!id) { - err = pouchdbErrors.createError(pouchdbErrors.MISSING_ID); - } else if (typeof id !== 'string') { - err = pouchdbErrors.createError(pouchdbErrors.INVALID_ID); - } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) { - err = pouchdbErrors.createError(pouchdbErrors.RESERVED_ID); - } - if (err) { - throw err; +function match(userOperator, doc, userValue, parsedField, docFieldValue) { + if (!matchers[userOperator]) { + throw new Error('unknown operator "' + userOperator + + '" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' + + '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all'); } + return matchers[userOperator](doc, userValue, parsedField, docFieldValue); } -function isCordova() { - return (typeof cordova !== "undefined" || - typeof PhoneGap !== "undefined" || - typeof phonegap !== "undefined"); +function fieldExists(docFieldValue) { + return typeof docFieldValue !== 'undefined' && docFieldValue !== null; +} + +function fieldIsNotUndefined(docFieldValue) { + return typeof docFieldValue !== 'undefined'; } -// Checks if a PouchDB object is "remote" or not. This is -// designed to opt-in to certain optimizations, such as -// avoiding checks for "dependentDbs" and other things that -// we know only apply to local databases. In general, "remote" -// should be true for the http adapter, and for third-party -// adapters with similar expensive boundaries to cross for -// every API call, such as socket-pouch and worker-pouch. -// Previously, this was handled via db.type() === 'http' -// which is now deprecated. +function modField(docFieldValue, userValue) { + var divisor = userValue[0]; + var mod = userValue[1]; + if (divisor === 0) { + throw new Error('Bad divisor, cannot divide by zero'); + } -function isRemote(db) { - if (typeof db._remote === 'boolean') { - return db._remote; + if (parseInt(divisor, 10) !== divisor ) { + throw new Error('Divisor is not an integer'); } - /* istanbul ignore next */ - if (typeof db.type === 'function') { - guardedConsole('warn', - 'db.type() is deprecated and will be removed in ' + - 'a future version of PouchDB'); - return db.type() === 'http'; + + if (parseInt(mod, 10) !== mod ) { + throw new Error('Modulus is not an integer'); } - /* istanbul ignore next */ - return false; + + if (parseInt(docFieldValue, 10) !== docFieldValue) { + return false; + } + + return docFieldValue % divisor === mod; } -function listenerCount(ee, type) { - return 'listenerCount' in ee ? ee.listenerCount(type) : - events.EventEmitter.listenerCount(ee, type); +function arrayContainsValue(docFieldValue, userValue) { + return userValue.some(function (val) { + if (docFieldValue instanceof Array) { + return docFieldValue.indexOf(val) > -1; + } + + return docFieldValue === val; + }); } -function parseDesignDocFunctionName(s) { - if (!s) { - return null; - } - var parts = s.split('/'); - if (parts.length === 2) { - return parts; - } - if (parts.length === 1) { - return [s, s]; - } - return null; +function arrayContainsAllValues(docFieldValue, userValue) { + return userValue.every(function (val) { + return docFieldValue.indexOf(val) > -1; + }); } -function normalizeDesignDocFunctionName(s) { - var normalized = parseDesignDocFunctionName(s); - return normalized ? normalized.join('/') : null; +function arraySize(docFieldValue, userValue) { + return docFieldValue.length === userValue; } -// originally parseUri 1.2.2, now patched by us -// (c) Steven Levithan -// MIT License -var keys = ["source", "protocol", "authority", "userInfo", "user", "password", - "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; -var qName ="queryKey"; -var qParser = /(?:^|&)([^&=]*)=?([^&]*)/g; +function regexMatch(docFieldValue, userValue) { + var re = new RegExp(userValue); -// use the "loose" parser -/* eslint maxlen: 0, no-useless-escape: 0 */ -var parser = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; + return re.test(docFieldValue); +} -function parseUri(str) { - var m = parser.exec(str); - var uri = {}; - var i = 14; +function typeMatch(docFieldValue, userValue) { - while (i--) { - var key = keys[i]; - var value = m[i] || ""; - var encoded = ['user', 'password'].indexOf(key) !== -1; - uri[key] = encoded ? decodeURIComponent(value) : value; + switch (userValue) { + case 'null': + return docFieldValue === null; + case 'boolean': + return typeof (docFieldValue) === 'boolean'; + case 'number': + return typeof (docFieldValue) === 'number'; + case 'string': + return typeof (docFieldValue) === 'string'; + case 'array': + return docFieldValue instanceof Array; + case 'object': + return ({}).toString.call(docFieldValue) === '[object Object]'; } - uri[qName] = {}; - uri[keys[12]].replace(qParser, function ($0, $1, $2) { - if ($1) { - uri[qName][$1] = $2; - } - }); + throw new Error(userValue + ' not supported as a type.' + + 'Please use one of object, string, array, number, boolean or null.'); - return uri; } -// Based on https://github.com/alexdavid/scope-eval v0.0.3 -// (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js) -// This is basically just a wrapper around new Function() +var matchers = { -function scopeEval(source, scope) { - var keys = []; - var values = []; - for (var key in scope) { - if (scope.hasOwnProperty(key)) { - keys.push(key); - values.push(scope[key]); + '$elemMatch': function (doc, userValue, parsedField, docFieldValue) { + if (!Array.isArray(docFieldValue)) { + return false; } - } - keys.push(source); - return Function.apply(null, keys).apply(null, values); -} - -// this is essentially the "update sugar" function from daleharvey/pouchdb#1388 -// the diffFun tells us what delta to apply to the doc. it either returns -// the doc, or false if it doesn't need to do an update after all -function upsert(db, docId, diffFun) { - return new Promise(function (fulfill, reject) { - db.get(docId, function (err, doc) { - if (err) { - /* istanbul ignore next */ - if (err.status !== 404) { - return reject(err); - } - doc = {}; - } - // the user might change the _rev, so save it for posterity - var docRev = doc._rev; - var newDoc = diffFun(doc); + if (docFieldValue.length === 0) { + return false; + } - if (!newDoc) { - // if the diffFun returns falsy, we short-circuit as - // an optimization - return fulfill({updated: false, rev: docRev}); - } + if (typeof docFieldValue[0] === 'object') { + return docFieldValue.some(function (val) { + return rowFilter(val, userValue, Object.keys(userValue)); + }); + } - // users aren't allowed to modify these values, - // so reset them here - newDoc._id = docId; - newDoc._rev = docRev; - fulfill(tryAndPut(db, newDoc, diffFun)); + return docFieldValue.some(function (val) { + return matchSelector(userValue, doc, parsedField, val); }); - }); -} + }, + + '$allMatch': function (doc, userValue, parsedField, docFieldValue) { + if (!Array.isArray(docFieldValue)) { + return false; + } -function tryAndPut(db, doc, diffFun) { - return db.put(doc).then(function (res) { - return { - updated: true, - rev: res.rev - }; - }, function (err) { /* istanbul ignore next */ - if (err.status !== 409) { - throw err; + if (docFieldValue.length === 0) { + return false; } - return upsert(db, doc._id, diffFun); - }); -} -function rev() { - return uuidV4.v4().replace(/-/g, '').toLowerCase(); -} + if (typeof docFieldValue[0] === 'object') { + return docFieldValue.every(function (val) { + return rowFilter(val, userValue, Object.keys(userValue)); + }); + } -var uuid = uuidV4.v4; + return docFieldValue.every(function (val) { + return matchSelector(userValue, doc, parsedField, val); + }); + }, -exports.adapterFun = adapterFun; -exports.assign = assign$1; -exports.bulkGetShim = bulkGet; -exports.changesHandler = Changes; -exports.clone = clone; -exports.defaultBackOff = defaultBackOff; -exports.explainError = explainError; -exports.filterChange = filterChange; -exports.flatten = flatten; -exports.functionName = res$1; -exports.guardedConsole = guardedConsole; -exports.hasLocalStorage = hasLocalStorage; -exports.invalidIdError = invalidIdError; -exports.isChromeApp = isChromeApp; -exports.isCordova = isCordova; -exports.isRemote = isRemote; -exports.listenerCount = listenerCount; -exports.nextTick = immediate; -exports.normalizeDdocFunctionName = normalizeDesignDocFunctionName; -exports.once = once; -exports.parseDdocFunctionName = parseDesignDocFunctionName; -exports.parseUri = parseUri; -exports.pick = pick; -exports.rev = rev; -exports.scopeEval = scopeEval; -exports.toPromise = toPromise; -exports.upsert = upsert; -exports.uuid = uuid; + '$eq': function (doc, userValue, parsedField, docFieldValue) { + return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) === 0; + }, + + '$gte': function (doc, userValue, parsedField, docFieldValue) { + return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) >= 0; + }, + + '$gt': function (doc, userValue, parsedField, docFieldValue) { + return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) > 0; + }, + + '$lte': function (doc, userValue, parsedField, docFieldValue) { + return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) <= 0; + }, + + '$lt': function (doc, userValue, parsedField, docFieldValue) { + return fieldIsNotUndefined(docFieldValue) && pouchdbCollate.collate(docFieldValue, userValue) < 0; + }, + + '$exists': function (doc, userValue, parsedField, docFieldValue) { + //a field that is null is still considered to exist + if (userValue) { + return fieldIsNotUndefined(docFieldValue); + } + + return !fieldIsNotUndefined(docFieldValue); + }, + + '$mod': function (doc, userValue, parsedField, docFieldValue) { + return fieldExists(docFieldValue) && modField(docFieldValue, userValue); + }, + + '$ne': function (doc, userValue, parsedField, docFieldValue) { + return userValue.every(function (neValue) { + return pouchdbCollate.collate(docFieldValue, neValue) !== 0; + }); + }, + '$in': function (doc, userValue, parsedField, docFieldValue) { + return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue); + }, + + '$nin': function (doc, userValue, parsedField, docFieldValue) { + return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue); + }, + + '$size': function (doc, userValue, parsedField, docFieldValue) { + return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue); + }, + + '$all': function (doc, userValue, parsedField, docFieldValue) { + return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue); + }, + + '$regex': function (doc, userValue, parsedField, docFieldValue) { + return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue); + }, + + '$type': function (doc, userValue, parsedField, docFieldValue) { + return typeMatch(docFieldValue, userValue); + } +}; + +// return true if the given doc matches the supplied selector +function matchesSelector(doc, selector) { + /* istanbul ignore if */ + if (typeof selector !== 'object') { + // match the CouchDB error message + throw new Error('Selector error: expected a JSON object'); + } + + selector = massageSelector(selector); + var row = { + 'doc': doc + }; + + var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector)); + return rowsMatched && rowsMatched.length === 1; +} + +exports.massageSelector = massageSelector; +exports.matchesSelector = matchesSelector; +exports.filterInMemoryFields = filterInMemoryFields; +exports.createFieldSorter = createFieldSorter; +exports.rowFilter = rowFilter; +exports.isCombinationalField = isCombinationalField; +exports.getKey = getKey; +exports.getValue = getValue; +exports.getFieldFromDoc = getFieldFromDoc; +exports.setFieldInDoc = setFieldInDoc; +exports.compare = compare; +exports.parseField = parseField; -},{"argsarray":39,"events":491,"immediate":543,"inherits":495,"pouchdb-collections":544,"pouchdb-errors":529,"pouchdb-promise":545,"uuid":606}],543:[function(require,module,exports){ +},{"pouchdb-collate":584,"pouchdb-utils":588}],583:[function(require,module,exports){ arguments[4][501][0].apply(exports,arguments) -},{"dup":501}],544:[function(require,module,exports){ -arguments[4][505][0].apply(exports,arguments) -},{"dup":505}],545:[function(require,module,exports){ -arguments[4][506][0].apply(exports,arguments) -},{"dup":506,"lie":500}],546:[function(require,module,exports){ +},{"dup":501}],584:[function(require,module,exports){ +arguments[4][554][0].apply(exports,arguments) +},{"dup":554}],585:[function(require,module,exports){ +arguments[4][508][0].apply(exports,arguments) +},{"dup":508}],586:[function(require,module,exports){ +arguments[4][509][0].apply(exports,arguments) +},{"dup":509,"inherits":495}],587:[function(require,module,exports){ +arguments[4][510][0].apply(exports,arguments) +},{"dup":510,"lie":500}],588:[function(require,module,exports){ +arguments[4][511][0].apply(exports,arguments) +},{"argsarray":39,"dup":511,"events":491,"immediate":583,"inherits":495,"pouchdb-collections":585,"pouchdb-errors":586,"pouchdb-promise":587,"uuid":589}],589:[function(require,module,exports){ +arguments[4][512][0].apply(exports,arguments) +},{"./v1":592,"./v4":593,"dup":512}],590:[function(require,module,exports){ +arguments[4][513][0].apply(exports,arguments) +},{"dup":513}],591:[function(require,module,exports){ +arguments[4][514][0].apply(exports,arguments) +},{"dup":514}],592:[function(require,module,exports){ +arguments[4][515][0].apply(exports,arguments) +},{"./lib/bytesToUuid":590,"./lib/rng":591,"dup":515}],593:[function(require,module,exports){ +arguments[4][516][0].apply(exports,arguments) +},{"./lib/bytesToUuid":590,"./lib/rng":591,"dup":516}],594:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -41817,7 +42126,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],547:[function(require,module,exports){ +},{}],595:[function(require,module,exports){ void function(root){ // return a number between 0 and max-1 @@ -41854,7 +42163,7 @@ void function(root){ }(this) -},{}],548:[function(require,module,exports){ +},{}],596:[function(require,module,exports){ // This method of obtaining a reference to the global object needs to be // kept identical to the way it is obtained in runtime.js var g = (function() { return this })() || Function("return this")(); @@ -41884,7 +42193,7 @@ if (hadRuntime) { } } -},{"./runtime":549}],549:[function(require,module,exports){ +},{"./runtime":597}],597:[function(require,module,exports){ /** * Copyright (c) 2014, Facebook, Inc. * All rights reserved. @@ -42616,7 +42925,7 @@ if (hadRuntime) { (function() { return this })() || Function("return this")() ); -},{}],550:[function(require,module,exports){ +},{}],598:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -42666,7 +42975,7 @@ var BehaviorSubject = (function (_super) { }(Subject_1.Subject)); exports.BehaviorSubject = BehaviorSubject; -},{"./Subject":557,"./util/ObjectUnsubscribedError":582}],551:[function(require,module,exports){ +},{"./Subject":605,"./util/ObjectUnsubscribedError":630}],599:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -42703,7 +43012,7 @@ var InnerSubscriber = (function (_super) { }(Subscriber_1.Subscriber)); exports.InnerSubscriber = InnerSubscriber; -},{"./Subscriber":559}],552:[function(require,module,exports){ +},{"./Subscriber":607}],600:[function(require,module,exports){ "use strict"; var Observable_1 = require('./Observable'); /** @@ -42831,7 +43140,7 @@ var Notification = (function () { }()); exports.Notification = Notification; -},{"./Observable":553}],553:[function(require,module,exports){ +},{"./Observable":601}],601:[function(require,module,exports){ "use strict"; var root_1 = require('./util/root'); var toSubscriber_1 = require('./util/toSubscriber'); @@ -43137,7 +43446,7 @@ var Observable = (function () { }()); exports.Observable = Observable; -},{"./symbol/observable":579,"./util/pipe":594,"./util/root":595,"./util/toSubscriber":597}],554:[function(require,module,exports){ +},{"./symbol/observable":627,"./util/pipe":642,"./util/root":643,"./util/toSubscriber":645}],602:[function(require,module,exports){ "use strict"; exports.empty = { closed: true, @@ -43146,7 +43455,7 @@ exports.empty = { complete: function () { } }; -},{}],555:[function(require,module,exports){ +},{}],603:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -43177,7 +43486,7 @@ var OuterSubscriber = (function (_super) { }(Subscriber_1.Subscriber)); exports.OuterSubscriber = OuterSubscriber; -},{"./Subscriber":559}],556:[function(require,module,exports){ +},{"./Subscriber":607}],604:[function(require,module,exports){ "use strict"; /** * An execution context and a data structure to order tasks and schedule their @@ -43227,7 +43536,7 @@ var Scheduler = (function () { }()); exports.Scheduler = Scheduler; -},{}],557:[function(require,module,exports){ +},{}],605:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -43396,7 +43705,7 @@ var AnonymousSubject = (function (_super) { }(Subject)); exports.AnonymousSubject = AnonymousSubject; -},{"./Observable":553,"./SubjectSubscription":558,"./Subscriber":559,"./Subscription":560,"./symbol/rxSubscriber":580,"./util/ObjectUnsubscribedError":582}],558:[function(require,module,exports){ +},{"./Observable":601,"./SubjectSubscription":606,"./Subscriber":607,"./Subscription":608,"./symbol/rxSubscriber":628,"./util/ObjectUnsubscribedError":630}],606:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -43437,7 +43746,7 @@ var SubjectSubscription = (function (_super) { }(Subscription_1.Subscription)); exports.SubjectSubscription = SubjectSubscription; -},{"./Subscription":560}],559:[function(require,module,exports){ +},{"./Subscription":608}],607:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -43703,7 +44012,7 @@ var SafeSubscriber = (function (_super) { return SafeSubscriber; }(Subscriber)); -},{"./Observer":554,"./Subscription":560,"./symbol/rxSubscriber":580,"./util/isFunction":589}],560:[function(require,module,exports){ +},{"./Observer":602,"./Subscription":608,"./symbol/rxSubscriber":628,"./util/isFunction":637}],608:[function(require,module,exports){ "use strict"; var isArray_1 = require('./util/isArray'); var isObject_1 = require('./util/isObject'); @@ -43897,7 +44206,7 @@ function flattenUnsubscriptionErrors(errors) { return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []); } -},{"./util/UnsubscriptionError":583,"./util/errorObject":584,"./util/isArray":586,"./util/isFunction":589,"./util/isObject":590,"./util/tryCatch":598}],561:[function(require,module,exports){ +},{"./util/UnsubscriptionError":631,"./util/errorObject":632,"./util/isArray":634,"./util/isFunction":637,"./util/isObject":638,"./util/tryCatch":646}],609:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44020,7 +44329,7 @@ var ArrayObservable = (function (_super) { }(Observable_1.Observable)); exports.ArrayObservable = ArrayObservable; -},{"../Observable":553,"../util/isScheduler":592,"./EmptyObservable":562,"./ScalarObservable":564}],562:[function(require,module,exports){ +},{"../Observable":601,"../util/isScheduler":640,"./EmptyObservable":610,"./ScalarObservable":612}],610:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44102,7 +44411,7 @@ var EmptyObservable = (function (_super) { }(Observable_1.Observable)); exports.EmptyObservable = EmptyObservable; -},{"../Observable":553}],563:[function(require,module,exports){ +},{"../Observable":601}],611:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44319,7 +44628,7 @@ var FromEventObservable = (function (_super) { }(Observable_1.Observable)); exports.FromEventObservable = FromEventObservable; -},{"../Observable":553,"../Subscription":560,"../util/errorObject":584,"../util/isFunction":589,"../util/tryCatch":598}],564:[function(require,module,exports){ +},{"../Observable":601,"../Subscription":608,"../util/errorObject":632,"../util/isFunction":637,"../util/tryCatch":646}],612:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44378,12 +44687,12 @@ var ScalarObservable = (function (_super) { }(Observable_1.Observable)); exports.ScalarObservable = ScalarObservable; -},{"../Observable":553}],565:[function(require,module,exports){ +},{"../Observable":601}],613:[function(require,module,exports){ "use strict"; var FromEventObservable_1 = require('./FromEventObservable'); exports.fromEvent = FromEventObservable_1.FromEventObservable.create; -},{"./FromEventObservable":563}],566:[function(require,module,exports){ +},{"./FromEventObservable":611}],614:[function(require,module,exports){ "use strict"; var Observable_1 = require('../Observable'); var ArrayObservable_1 = require('./ArrayObservable'); @@ -44474,7 +44783,7 @@ function merge() { } exports.merge = merge; -},{"../Observable":553,"../operators/mergeAll":572,"../util/isScheduler":592,"./ArrayObservable":561}],567:[function(require,module,exports){ +},{"../Observable":601,"../operators/mergeAll":620,"../util/isScheduler":640,"./ArrayObservable":609}],615:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44610,7 +44919,7 @@ var DelayMessage = (function () { return DelayMessage; }()); -},{"../Notification":552,"../Subscriber":559,"../scheduler/async":577,"../util/isDate":588}],568:[function(require,module,exports){ +},{"../Notification":600,"../Subscriber":607,"../scheduler/async":625,"../util/isDate":636}],616:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44719,7 +45028,7 @@ var DistinctUntilChangedSubscriber = (function (_super) { return DistinctUntilChangedSubscriber; }(Subscriber_1.Subscriber)); -},{"../Subscriber":559,"../util/errorObject":584,"../util/tryCatch":598}],569:[function(require,module,exports){ +},{"../Subscriber":607,"../util/errorObject":632,"../util/tryCatch":646}],617:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44814,7 +45123,7 @@ var FilterSubscriber = (function (_super) { return FilterSubscriber; }(Subscriber_1.Subscriber)); -},{"../Subscriber":559}],570:[function(require,module,exports){ +},{"../Subscriber":607}],618:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -44967,7 +45276,7 @@ var FirstSubscriber = (function (_super) { return FirstSubscriber; }(Subscriber_1.Subscriber)); -},{"../Subscriber":559,"../util/EmptyError":581}],571:[function(require,module,exports){ +},{"../Subscriber":607,"../util/EmptyError":629}],619:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45057,7 +45366,7 @@ var MapSubscriber = (function (_super) { return MapSubscriber; }(Subscriber_1.Subscriber)); -},{"../Subscriber":559}],572:[function(require,module,exports){ +},{"../Subscriber":607}],620:[function(require,module,exports){ "use strict"; var mergeMap_1 = require('./mergeMap'); var identity_1 = require('../util/identity'); @@ -45111,7 +45420,7 @@ function mergeAll(concurrent) { } exports.mergeAll = mergeAll; -},{"../util/identity":585,"./mergeMap":573}],573:[function(require,module,exports){ +},{"../util/identity":633,"./mergeMap":621}],621:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45285,7 +45594,7 @@ var MergeMapSubscriber = (function (_super) { }(OuterSubscriber_1.OuterSubscriber)); exports.MergeMapSubscriber = MergeMapSubscriber; -},{"../OuterSubscriber":555,"../util/subscribeToResult":596}],574:[function(require,module,exports){ +},{"../OuterSubscriber":603,"../util/subscribeToResult":644}],622:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45330,7 +45639,7 @@ var Action = (function (_super) { }(Subscription_1.Subscription)); exports.Action = Action; -},{"../Subscription":560}],575:[function(require,module,exports){ +},{"../Subscription":608}],623:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45473,7 +45782,7 @@ var AsyncAction = (function (_super) { }(Action_1.Action)); exports.AsyncAction = AsyncAction; -},{"../util/root":595,"./Action":574}],576:[function(require,module,exports){ +},{"../util/root":643,"./Action":622}],624:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45525,7 +45834,7 @@ var AsyncScheduler = (function (_super) { }(Scheduler_1.Scheduler)); exports.AsyncScheduler = AsyncScheduler; -},{"../Scheduler":556}],577:[function(require,module,exports){ +},{"../Scheduler":604}],625:[function(require,module,exports){ "use strict"; var AsyncAction_1 = require('./AsyncAction'); var AsyncScheduler_1 = require('./AsyncScheduler'); @@ -45573,7 +45882,7 @@ var AsyncScheduler_1 = require('./AsyncScheduler'); */ exports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction); -},{"./AsyncAction":575,"./AsyncScheduler":576}],578:[function(require,module,exports){ +},{"./AsyncAction":623,"./AsyncScheduler":624}],626:[function(require,module,exports){ "use strict"; var root_1 = require('../util/root'); function symbolIteratorPonyfill(root) { @@ -45612,7 +45921,7 @@ exports.iterator = symbolIteratorPonyfill(root_1.root); */ exports.$$iterator = exports.iterator; -},{"../util/root":595}],579:[function(require,module,exports){ +},{"../util/root":643}],627:[function(require,module,exports){ "use strict"; var root_1 = require('../util/root'); function getSymbolObservable(context) { @@ -45639,7 +45948,7 @@ exports.observable = getSymbolObservable(root_1.root); */ exports.$$observable = exports.observable; -},{"../util/root":595}],580:[function(require,module,exports){ +},{"../util/root":643}],628:[function(require,module,exports){ "use strict"; var root_1 = require('../util/root'); var Symbol = root_1.root.Symbol; @@ -45650,7 +45959,7 @@ exports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'f */ exports.$$rxSubscriber = exports.rxSubscriber; -},{"../util/root":595}],581:[function(require,module,exports){ +},{"../util/root":643}],629:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45679,7 +45988,7 @@ var EmptyError = (function (_super) { }(Error)); exports.EmptyError = EmptyError; -},{}],582:[function(require,module,exports){ +},{}],630:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45707,7 +46016,7 @@ var ObjectUnsubscribedError = (function (_super) { }(Error)); exports.ObjectUnsubscribedError = ObjectUnsubscribedError; -},{}],583:[function(require,module,exports){ +},{}],631:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -45733,68 +46042,68 @@ var UnsubscriptionError = (function (_super) { }(Error)); exports.UnsubscriptionError = UnsubscriptionError; -},{}],584:[function(require,module,exports){ +},{}],632:[function(require,module,exports){ "use strict"; // typeof any so that it we don't have to cast when comparing a result to the error object exports.errorObject = { e: {} }; -},{}],585:[function(require,module,exports){ +},{}],633:[function(require,module,exports){ "use strict"; function identity(x) { return x; } exports.identity = identity; -},{}],586:[function(require,module,exports){ +},{}],634:[function(require,module,exports){ "use strict"; exports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); -},{}],587:[function(require,module,exports){ +},{}],635:[function(require,module,exports){ "use strict"; exports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; }); -},{}],588:[function(require,module,exports){ +},{}],636:[function(require,module,exports){ "use strict"; function isDate(value) { return value instanceof Date && !isNaN(+value); } exports.isDate = isDate; -},{}],589:[function(require,module,exports){ +},{}],637:[function(require,module,exports){ "use strict"; function isFunction(x) { return typeof x === 'function'; } exports.isFunction = isFunction; -},{}],590:[function(require,module,exports){ +},{}],638:[function(require,module,exports){ "use strict"; function isObject(x) { return x != null && typeof x === 'object'; } exports.isObject = isObject; -},{}],591:[function(require,module,exports){ +},{}],639:[function(require,module,exports){ "use strict"; function isPromise(value) { return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; } exports.isPromise = isPromise; -},{}],592:[function(require,module,exports){ +},{}],640:[function(require,module,exports){ "use strict"; function isScheduler(value) { return value && typeof value.schedule === 'function'; } exports.isScheduler = isScheduler; -},{}],593:[function(require,module,exports){ +},{}],641:[function(require,module,exports){ "use strict"; /* tslint:disable:no-empty */ function noop() { } exports.noop = noop; -},{}],594:[function(require,module,exports){ +},{}],642:[function(require,module,exports){ "use strict"; var noop_1 = require('./noop'); /* tslint:enable:max-line-length */ @@ -45820,7 +46129,7 @@ function pipeFromArray(fns) { } exports.pipeFromArray = pipeFromArray; -},{"./noop":593}],595:[function(require,module,exports){ +},{"./noop":641}],643:[function(require,module,exports){ (function (global){ "use strict"; // CommonJS / Node have global context exposed as "global" variable. @@ -45842,7 +46151,7 @@ exports.root = _root; })(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],596:[function(require,module,exports){ +},{}],644:[function(require,module,exports){ "use strict"; var root_1 = require('./root'); var isArrayLike_1 = require('./isArrayLike'); @@ -45922,7 +46231,7 @@ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { } exports.subscribeToResult = subscribeToResult; -},{"../InnerSubscriber":551,"../Observable":553,"../symbol/iterator":578,"../symbol/observable":579,"./isArrayLike":587,"./isObject":590,"./isPromise":591,"./root":595}],597:[function(require,module,exports){ +},{"../InnerSubscriber":599,"../Observable":601,"../symbol/iterator":626,"../symbol/observable":627,"./isArrayLike":635,"./isObject":638,"./isPromise":639,"./root":643}],645:[function(require,module,exports){ "use strict"; var Subscriber_1 = require('../Subscriber'); var rxSubscriber_1 = require('../symbol/rxSubscriber'); @@ -45943,7 +46252,7 @@ function toSubscriber(nextOrObserver, error, complete) { } exports.toSubscriber = toSubscriber; -},{"../Observer":554,"../Subscriber":559,"../symbol/rxSubscriber":580}],598:[function(require,module,exports){ +},{"../Observer":602,"../Subscriber":607,"../symbol/rxSubscriber":628}],646:[function(require,module,exports){ "use strict"; var errorObject_1 = require('./errorObject'); var tryCatchTarget; @@ -45963,7 +46272,7 @@ function tryCatch(fn) { exports.tryCatch = tryCatch; ; -},{"./errorObject":584}],599:[function(require,module,exports){ +},{"./errorObject":632}],647:[function(require,module,exports){ (function (factory) { if (typeof exports === 'object') { // Node/CommonJS @@ -46716,7 +47025,7 @@ exports.tryCatch = tryCatch; return SparkMD5; })); -},{}],600:[function(require,module,exports){ +},{}],648:[function(require,module,exports){ module.exports = (function() { var exports = {}; @@ -46755,7 +47064,7 @@ module.exports = (function() { return exports; })(); -},{}],601:[function(require,module,exports){ +},{}],649:[function(require,module,exports){ module.exports = (function( envs ) { @@ -46832,7 +47141,7 @@ module.exports = (function( browser: require('./browser.js') }); -},{"./browser.js":600,"./node.js":602}],602:[function(require,module,exports){ +},{"./browser.js":648,"./node.js":650}],650:[function(require,module,exports){ (function (process){ module.exports = (function() { var exports = {}; @@ -46902,16 +47211,16 @@ module.exports = (function() { })(); }).call(this,require('_process')) -},{"_process":546}],603:[function(require,module,exports){ +},{"_process":594}],651:[function(require,module,exports){ arguments[4][495][0].apply(exports,arguments) -},{"dup":495}],604:[function(require,module,exports){ +},{"dup":495}],652:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],605:[function(require,module,exports){ +},{}],653:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // @@ -47501,212 +47810,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":604,"_process":546,"inherits":603}],606:[function(require,module,exports){ -var v1 = require('./v1'); -var v4 = require('./v4'); - -var uuid = v4; -uuid.v1 = v1; -uuid.v4 = v4; - -module.exports = uuid; - -},{"./v1":609,"./v4":610}],607:[function(require,module,exports){ -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} - -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; -} - -module.exports = bytesToUuid; - -},{}],608:[function(require,module,exports){ -(function (global){ -// Unique ID creation requires a high quality random # generator. In the -// browser this is a little complicated due to unknown quality of Math.random() -// and inconsistent support for the `crypto` API. We do the best we can via -// feature-detection -var rng; - -var crypto = global.crypto || global.msCrypto; // for IE 11 -if (crypto && crypto.getRandomValues) { - // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto - var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef - rng = function whatwgRNG() { - crypto.getRandomValues(rnds8); - return rnds8; - }; -} - -if (!rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var rnds = new Array(16); - rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return rnds; - }; -} - -module.exports = rng; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],609:[function(require,module,exports){ -var rng = require('./lib/rng'); -var bytesToUuid = require('./lib/bytesToUuid'); - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -// random #'s we need to init node and clockseq -var _seedBytes = rng(); - -// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) -var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] -]; - -// Per 4.2.2, randomize (14 bit) clockseq -var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - -// Previous uuid creation time -var _lastMSecs = 0, _lastNSecs = 0; - -// See https://github.com/broofa/node-uuid for API details -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf ? buf : bytesToUuid(b); -} - -module.exports = v1; - -},{"./lib/bytesToUuid":607,"./lib/rng":608}],610:[function(require,module,exports){ -var rng = require('./lib/rng'); -var bytesToUuid = require('./lib/bytesToUuid'); - -function v4(options, buf, offset) { - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new Array(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || bytesToUuid(rnds); -} - -module.exports = v4; - -},{"./lib/bytesToUuid":607,"./lib/rng":608}],611:[function(require,module,exports){ +},{"./support/isBuffer":652,"_process":594,"inherits":651}],654:[function(require,module,exports){ 'use strict'; /** @@ -47881,7 +47985,7 @@ exports.parse = function (str) { } }; -},{}],612:[function(require,module,exports){ +},{}],655:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; diff --git a/dist/rxdb.browserify.min.js b/dist/rxdb.browserify.min.js index 164a42693af..83631b2a7cc 100644 --- a/dist/rxdb.browserify.min.js +++ b/dist/rxdb.browserify.min.js @@ -1 +1 @@ -!function e(t,r,n){function o(a,u){if(!r[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r=t[a][1][e];return o(r||e)},f,f.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;athis.limit;)this.buffer.shift()}},{key:"getArrayIndexByPointer",value:function(e){var t=this.buffer[0],r=this.eventCounterMap.get(t);if(e0&&void 0!==arguments[0]?arguments[0]:10;if(this._migrated)throw l.default.newRxError("DM1");this._migrated=!0;var r={done:!1,total:null,handled:0,success:0,deleted:0,percent:0};return new p.Observable(function(){var i=(0,o.default)(n.default.mark(function o(i){var a,u,c,f,l;return n.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,e._getOldCollections();case 2:return a=o.sent,o.next=5,Promise.all(a.map(function(e){return e.countAllUndeleted()}));case 5:u=o.sent,c=u.reduce(function(e,t){return e+t},0),r.total=c,i.next((0,s.default)(r)),f=null,l=n.default.mark(function o(){var a;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=f.migrate(t),e.next=3,new Promise(function(e){var t=a.subscribe(function(e){r.handled++,r[e.type]=r[e.type]+1,r.percent=Math.round(r.handled/r.total*100),i.next((0,s.default)(r))},function(e){t.unsubscribe(),i.error(e)},function(){t.unsubscribe(),e()})});case 3:case"end":return e.stop()}},o,e)});case 11:if(!(f=a.shift())){o.next=15;break}return o.delegateYield(l(),"t0",13);case 13:o.next=11;break;case 15:r.done=!0,r.percent=100,i.next((0,s.default)(r)),i.complete();case 19:case"end":return o.stop()}},o,e)}));return function(e){return i.apply(this,arguments)}}())}},{key:"migratePromise",value:function(e){var t=this;return this._migratePromise||(this._migratePromise=new Promise(function(r,n){t.migrate(e).subscribe(null,n,r)})),this._migratePromise}}]),e}(),y=function(){function e(t,r,n){(0,i.default)(this,e),this.version=t,this.dataMigrator=n,this.schemaObj=r,this.newestCollection=n.newestCollection,this.database=n.newestCollection.database}return(0,a.default)(e,[{key:"countAllUndeleted",value:function(){var e=(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.default.countAllUndeleted(this.pouchdb));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getBatch",value:function(e){var t=this;return u.default.getBatch(this.pouchdb,e).then(function(e){return e.map(function(e){return t._handleFromPouch(e)})})}},{key:"_handleFromPouch",value:function(e){var t=(0,s.default)(e);return t=this.schema.swapIdToPrimary(e),this.schema.doKeyCompression()&&(t=this.keyCompressor.decompress(t)),t=this.crypter.decrypt(t)}},{key:"_handleToPouch",value:function(e){var t=(0,s.default)(e);return t=this.crypter.encrypt(t),t=this.schema.swapPrimaryToId(t),this.schema.doKeyCompression()&&(t=this.keyCompressor.compress(t)),t}},{key:"migrateDocumentData",value:function(){var e=(0,o.default)(n.default.mark(function e(t){var r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,s.default)(t),r=this.version+1;case 2:if(!(r<=this.newestCollection.schema.version)){e.next=11;break}return e.next=5,this.dataMigrator.migrationStrategies[r+""](t);case 5:if(t=e.sent,r++,null!==t){e.next=9;break}return e.abrupt("return",null);case 9:e.next=2;break;case 11:e.prev=11,this.newestCollection.schema.validate(t),e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(11),l.default.newRxError("DM2",{fromVersion:this.version,toVersion:this.newestCollection.schema.version,finalDoc:t});case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}},e,this,[[11,15]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_migrateDocument",value:function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o,i;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.migrateDocumentData(t);case 2:if(r=e.sent,o={doc:t,migrated:r,oldCollection:this,newestCollection:this.newestCollection},!r){e.next=16;break}return h.default.runPluginHooks("preMigrateDocument",o),delete r._rev,e.next=9,this.newestCollection._pouchPut(r,!0);case 9:return i=e.sent,o.res=i,o.type="success",e.next=14,h.default.runAsyncPluginHooks("postMigrateDocument",o);case 14:e.next=17;break;case 16:o.type="deleted";case 17:return e.prev=17,e.next=20,this.pouchdb.remove(this._handleToPouch(t));case 20:e.next=24;break;case 22:e.prev=22,e.t0=e.catch(17);case 24:return e.abrupt("return",o);case 25:case"end":return e.stop()}},e,this,[[17,22]])}));return function(t){return e.apply(this,arguments)}}()},{key:"delete",value:function(){var e=this;return this.pouchdb.destroy().then(function(){return e.database.removeCollectionDoc(e.dataMigrator.name,e.schema)})}},{key:"migrate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(this._migrate)throw l.default.newRxError("DM3");this._migrate=!0;return new p.Observable(function(){var r=(0,o.default)(n.default.mark(function r(o){var i,a;return n.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.getBatch(t);case 2:i=r.sent,a=void 0;case 4:return r.next=6,Promise.all(i.map(function(t){return e._migrateDocument(t).then(function(e){return o.next(e)})})).catch(function(e){return a=e});case 6:if(!a){r.next=9;break}return o.error(a),r.abrupt("return");case 9:return r.next=11,e.getBatch(t);case 11:i=r.sent;case 12:if(!a&&i.length>0){r.next=4;break}case 13:return r.next=15,e.delete();case 15:o.complete();case 16:case"end":return r.stop()}},r,e)}));return function(e){return r.apply(this,arguments)}}())}},{key:"migratePromise",value:function(e){var t=this;return this._migratePromise||(this._migratePromise=new Promise(function(r,n){t.migrate(e).subscribe(null,n,r)})),this._migratePromise}},{key:"schema",get:function(){return this._schema||(this._schema=c.default.create(this.schemaObj,!1)),this._schema}},{key:"keyCompressor",get:function(){return this._keyCompressor||(this._keyCompressor=d.default.createKeyCompressor(this.schema)),this._keyCompressor}},{key:"crypter",get:function(){return this._crypter||(this._crypter=f.default.create(this.database.password,this.schema)),this._crypter}},{key:"pouchdb",get:function(){return this._pouchdb||(this._pouchdb=this.database._spawnPouchDB(this.newestCollection.name,this.version,this.newestCollection.pouchSettings)),this._pouchdb}}]),e}();function _(e,t){return new v(e,t)}r.default={create:_}},{"./crypter":4,"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-error":34,"./rx-schema":36,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,clone:60,"rxjs/Observable":553}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=i(e("babel-runtime/helpers/classCallCheck")),o=i(e("babel-runtime/helpers/createClass"));r.create=u;function i(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(){(0,n.default)(this,e),this._map=new Map}return(0,o.default)(e,[{key:"get",value:function(e){return this._map.get(e)}},{key:"set",value:function(e,t){return this._map.set(e,t)}},{key:"delete",value:function(e){this._map.delete(e)}}]),e}();function u(){return new a}r.default={create:u}},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.runAsyncPluginHooks=r.HOOKS=void 0;var n=a(e("babel-runtime/regenerator")),o=a(e("babel-runtime/helpers/asyncToGenerator")),i=r.runAsyncPluginHooks=function(){var e=(0,o.default)(n.default.mark(function e(t,r){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(u[t].map(function(e){return e(r)})));case 1:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}();r.runPluginHooks=s;function a(e){return e&&e.__esModule?e:{default:e}}var u=r.HOOKS={createRxDatabase:[],createRxCollection:[],preCreateRxSchema:[],createRxSchema:[],createRxQuery:[],createRxDocument:[],postCreateRxDocument:[],preCreatePouchDb:[],preMigrateDocument:[],postMigrateDocument:[]};function s(e,t){u[e].forEach(function(e){return e(t)})}r.default={runPluginHooks:s,runAsyncPluginHooks:i,HOOKS:u}},{"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/regenerator":57}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.checkAdapter=r.RxDatabase=r.QueryChangeDetector=r.PouchDB=r.RxSchema=r.isRxSchema=r.isRxQuery=r.isRxDocument=r.isRxCollection=r.isRxDatabase=r.dbCount=r.plugin=r.removeDatabase=r.create=void 0;var n=y(e("./core")),o=y(e("./plugins/schema-check")),i=y(e("./plugins/error-messages")),a=y(e("./plugins/validate")),u=y(e("./plugins/key-compression")),s=y(e("./plugins/leader-election")),c=y(e("./plugins/encryption")),f=y(e("./plugins/update")),l=y(e("./plugins/replication")),d=y(e("./plugins/adapter-check")),h=y(e("./plugins/json-dump")),p=y(e("./plugins/in-memory")),b=y(e("./plugins/attachments")),v=y(e("./plugins/local-documents"));function y(e){return e&&e.__esModule?e:{default:e}}n.default.plugin(o.default),n.default.plugin(i.default),n.default.plugin(a.default),n.default.plugin(u.default),n.default.plugin(s.default),n.default.plugin(c.default),n.default.plugin(f.default),n.default.plugin(l.default),n.default.plugin(d.default),n.default.plugin(h.default),n.default.plugin(p.default),n.default.plugin(b.default),n.default.plugin(v.default);var _=r.create=n.default.create,m=r.removeDatabase=n.default.removeDatabase,g=r.plugin=n.default.plugin,w=r.dbCount=n.default.dbCount,x=r.isRxDatabase=n.default.isRxDatabase,k=r.isRxCollection=n.default.isRxCollection,j=r.isRxDocument=n.default.isRxDocument,O=r.isRxQuery=n.default.isRxQuery,S=r.isRxSchema=n.default.isRxSchema,E=r.RxSchema=n.default.RxSchema,C=r.PouchDB=n.default.PouchDB,A=r.QueryChangeDetector=n.default.QueryChangeDetector,P=r.RxDatabase=n.default.RxDatabase,R=r.checkAdapter=n.default.checkAdapter;r.default={create:_,checkAdapter:R,removeDatabase:m,plugin:g,dbCount:w,isRxDatabase:x,isRxCollection:k,isRxDocument:j,isRxQuery:O,isRxSchema:S,RxSchema:E,PouchDB:C,QueryChangeDetector:A,RxDatabase:P}},{"./core":3,"./plugins/adapter-check":13,"./plugins/attachments":14,"./plugins/encryption":15,"./plugins/error-messages":16,"./plugins/in-memory":17,"./plugins/json-dump":18,"./plugins/key-compression":19,"./plugins/leader-election":20,"./plugins/local-documents":21,"./plugins/replication":22,"./plugins/schema-check":23,"./plugins/update":24,"./plugins/validate":25}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=c(e("babel-runtime/helpers/typeof")),o=c(e("babel-runtime/helpers/classCallCheck")),i=c(e("babel-runtime/helpers/createClass")),a=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./mquery_utils")),u=c(e("../rx-error")),s=c(e("clone"));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(t){(0,o.default)(this,e);var r=this.constructor.prototype;this.options={},this._conditions=r._conditions?(0,s.default)(r._conditions):{},this._fields=r._fields?(0,s.default)(r._fields):void 0,this._path=r._path||void 0,t&&this.find(t)}return(0,i.default)(e,[{key:"clone",value:function(){var t=new e;return Object.entries(this).forEach(function(e){t[e[0]]=(0,s.default)(e[1])}),t}},{key:"where",value:function(){if(!arguments.length)return this;var e=(0,n.default)(arguments[0]);if("string"===e)return this._path=arguments[0],2===arguments.length&&(this._conditions[this._path]=arguments[1]),this;if("object"===e&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw u.default.newRxTypeError("MQ1",{path:arguments[0]})}},{key:"equals",value:function(e){this._ensurePath("equals");var t=this._path;return this._conditions[t]=e,this}},{key:"eq",value:function(e){this._ensurePath("eq");var t=this._path;return this._conditions[t]=e,this}},{key:"or",value:function(e){var t=this._conditions.$or||(this._conditions.$or=[]);return Array.isArray(e)||(e=[e]),t.push.apply(t,e),this}},{key:"nor",value:function(e){var t=this._conditions.$nor||(this._conditions.$nor=[]);return Array.isArray(e)||(e=[e]),t.push.apply(t,e),this}},{key:"and",value:function(e){var t=this._conditions.$and||(this._conditions.$and=[]);return Array.isArray(e)||(e=[e]),t.push.apply(t,e),this}},{key:"mod",value:function(){var e=void 0,t=void 0;1===arguments.length?(this._ensurePath("mod"),e=arguments[0],t=this._path):2!==arguments.length||Array.isArray(arguments[1])?3===arguments.length?(e=arguments.slice(1),t=arguments[0]):(e=arguments[1],t=arguments[0]):(this._ensurePath("mod"),e=arguments.slice(),t=this._path);return(this._conditions[t]||(this._conditions[t]={})).$mod=e,this}},{key:"exists",value:function(){var e=void 0,t=void 0;0===arguments.length?(this._ensurePath("exists"),e=this._path,t=!0):1===arguments.length?"boolean"==typeof arguments[0]?(this._ensurePath("exists"),e=this._path,t=arguments[0]):(e=arguments[0],t=!0):2===arguments.length&&(e=arguments[0],t=arguments[1]);return(this._conditions[e]||(this._conditions[e]={})).$exists=t,this}},{key:"elemMatch",value:function(){if(null===arguments[0])throw u.default.newRxTypeError("MQ2");var t=void 0,r=void 0,n=void 0;if("function"==typeof arguments[0])this._ensurePath("elemMatch"),r=this._path,t=arguments[0];else if(a.isObject(arguments[0]))this._ensurePath("elemMatch"),r=this._path,n=arguments[0];else if("function"==typeof arguments[1])r=arguments[0],t=arguments[1];else{if(!arguments[1]||!a.isObject(arguments[1]))throw u.default.newRxTypeError("MQ2");r=arguments[0],n=arguments[1]}t&&(t(n=new e),n=n._conditions);return(this._conditions[r]||(this._conditions[r]={})).$elemMatch=n,this}},{key:"sort",value:function(e){var t=this;if(!e)return this;var r=void 0,o=void 0===e?"undefined":(0,n.default)(e);if(Array.isArray(e)){r=e.length;for(var i=0;i 2",QU1:"RxQuery._execOverDatabase(): op not known",QU2:"limit() must get a number",QU3:"skip() must get a number",QU4:"RxQuery.regex(): You cannot use .regex() on the primary field",QU5:"RxQuery.sort(): does not work because key is not defined in the schema",QU6:"RxQuery.limit(): cannot be called on .findOne()",QU7:"query must be an object",QU8:"query cannot be an array",MQ1:"path must be a string or object",MQ2:"Invalid argument",MQ3:"Invalid sort() argument. Must be a string, object, or array",MQ4:"Invalid argument. Expected instanceof mquery or plain object",MQ5:"method must be used after where() when called with these arguments",MQ6:"Can't mix sort syntaxes. Use either array or object | .sort([['field', 1], ['test', -1]]) | .sort({ field: 1, test: -1 })",MQ7:"Invalid sort value",MQ8:"Can't mix sort syntaxes. Use either array or object",DB1:"RxDocument.prepare(): another instance on this adapter has a different password",DB2:"RxDatabase.collection(): collection-names cannot start with underscore _",DB3:"RxDatabase.collection(): collection already exists. use myDatabase.[collectionName] to get it",DB4:"RxDatabase.collection(): schema is missing",DB5:"RxDatabase.collection(): collection-name not allowed",DB6:"RxDatabase.collection(): another instance created this collection with a different schema",DB7:"RxDatabase.collection(): schema encrypted but no password given",DB8:"RxDatabase.create(): A RxDatabase with the same name and adapter already exists.\nMake sure to use this combination only once or set ignoreDuplicate to true if you do this intentional",DB9:"RxDatabase.create(): Adapter not added. Use RxDB.plugin(require('pouchdb-adapter-[adaptername]');",DB10:"RxDatabase.create(): To use leveldown-adapters, you have to add the leveldb-plugin. Use RxDB.plugin(require('pouchdb-adapter-leveldb'));",COL1:"RxDocument.insert() You cannot insert an existing document",COL2:"RxCollection.insert() do not provide ._id, it will be generated",COL3:"RxCollection.upsert() does not work without primary",COL4:"RxCollection.atomicUpsert() does not work without primary",COL5:"RxCollection.find() if you want to search by _id, use .findOne(_id)",COL6:"RxCollection.findOne() needs a queryObject or string",COL7:"hook must be a function",COL8:"hooks-when not known",COL9:"RxCollection.addHook() hook-name not known",COL10:"RxCollection .postCreate-hooks cannot be async",COL11:"migrationStrategies must be an object",COL12:"A migrationStrategy is missing or too much",COL13:"migrationStrategy must be a function",COL14:"given static method-name is not a string",COL15:"static method-names cannot start with underscore _",COL16:"given static method is not a function",COL17:"RxCollection.ORM: statics-name not allowed",COL18:"collection-method not allowed because fieldname is in the schema",DOC1:"RxDocument.get$ cannot get observable of in-array fields because order cannot be guessed",DOC2:"cannot observe primary path",DOC3:"final fields cannot be observed",DOC4:"RxDocument.get$ cannot observe a non-existed field",DOC5:"RxDocument.populate() cannot populate a non-existed field",DOC6:"RxDocument.populate() cannot populate because path has no ref",DOC7:"RxDocument.populate() ref-collection not in database",DOC8:"RxDocument.set(): primary-key cannot be modified",DOC9:"final fields cannot be modified",DOC10:"RxDocument.set(): cannot set childpath when rootPath not selected",DOC11:"RxDocument.save(): cant save deleted document",DOC12:"RxDocument.save(): error",DOC13:"RxDocument.remove(): Document is already deleted",DOC14:"RxDocument.destroy() does not exist",DOC15:"query cannot be an array",DM1:"migrate() Migration has already run",DM2:"migration of document failed final document does not match final schema",DM3:"migration already running",AT1:"to use attachments, please define this in your schema",EN1:"password is no string",EN2:"validatePassword: min-length of password not complied",JD1:"You must create the collections before you can import their data",JD2:"RxCollection.importDump(): the imported json relies on a different schema",JD3:"RxCollection.importDump(): json.passwordHash does not match the own",LE1:"LeaderElection: this should not happen :( please contact the maintainer",LE2:"LeaderElection: someone else is applying/leader",LE3:"LeaderElection: someone else overwrote apply",LD1:"RxDocument.allAttachments$ cant use attachments on local documents",LD2:"RxDocument.get(): objPath must be a string",LD3:"RxDocument.get$ cannot get observable of in-array fields because order cannot be guessed",LD4:"cannot observe primary path",LD5:"RxDocument.set() id cannot be modified",LD6:"LocalDocument: Function is not useable on local documents",LD7:"Local document already exists",RC1:"Replication: already added",RC2:"RxCollection.sync() query must be from the same RxCollection",SC1:"fieldnames do not match the regex",SC2:"SchemaCheck: name 'item' reserved for array-fields",SC3:"SchemaCheck: fieldname has a ref-array but items-type is not string",SC4:"SchemaCheck: fieldname has a ref but is not type string or array",SC5:"SchemaCheck: fieldname cannot be primary and ref at same time",SC6:"SchemaCheck: primary can only be defined at top-level",SC7:"SchemaCheck: default-values can only be defined at top-level",SC8:"SchemaCheck: first level-fields cannot start with underscore _",SC9:"SchemaCheck: schema defines ._id, this will be done automatically",SC10:"SchemaCheck: schema defines ._rev, this will be done automatically",SC11:"SchemaCheck: schema need an number>=0 as version",SC12:"SchemaCheck: primary can only be defined once",SC13:"SchemaCheck: primary is always index, do not declare it as index",SC14:"SchemaCheck: primary is always unique, do not declare it as index",SC15:"SchemaCheck: primary cannot be encrypted",SC16:"SchemaCheck: primary must have type: string",SC17:"SchemaCheck: top-level fieldname is not allowed",SC18:"SchemaCheck: compoundIndexes must be an array",SC19:"SchemaCheck: compoundIndexes must contain arrays",SC20:"SchemaCheck: compoundIndexes.array must contains strings",SC21:"SchemaCheck: given index is not defined in schema",SC22:"given indexKey is not type:string",SC23:"SchemaCheck: fieldname is not allowed",VD1:"Sub-schema not found, does the schemaPath exists in your schema?",VD2:"object does not match schema",IM1:"InMemory: Memory-Adapter must be added. Use RxDB.plugin(require('pouchdb-adapter-memory'));"},o=r.rxdb=!0,i=r.prototypes={},a=r.overwritable={tunnelErrorMessage:function(e){if(!n[e])throw console.error("RxDB: Error-Code not known: "+e),new Error("Error-Cdoe "+e+" not known, contact the maintainer");return n[e]}};r.default={rxdb:o,prototypes:i,overwritable:a}},{}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=r.spawnInMemory=r.InMemoryRxCollection=void 0;var n=g(e("babel-runtime/helpers/typeof")),o=g(e("babel-runtime/regenerator")),i=g(e("babel-runtime/helpers/asyncToGenerator")),a=g(e("babel-runtime/helpers/classCallCheck")),u=g(e("babel-runtime/helpers/createClass")),s=g(e("babel-runtime/helpers/possibleConstructorReturn")),c=g(e("babel-runtime/helpers/inherits")),f=r.spawnInMemory=function(){var e=(0,i.default)(o.default.mark(function e(){var t,r;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(O){e.next=4;break}if(O=!0,_.default.adapters&&_.default.adapters.memory){e.next=4;break}throw m.default.newRxError("IM1");case 4:if(!w.has(this)){e.next=8;break}return e.next=7,x.get(this);case 7:return e.abrupt("return",w.get(this));case 8:return t=new j(this),r=t.prepare(),w.set(this,t),x.set(this,r),e.next=14,r;case 14:return e.abrupt("return",t);case 15:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),l=g(e("clone")),d=e("rxjs/Subject"),h=g(e("../rx-collection")),p=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util")),b=g(e("../crypter")),v=g(e("../change-event-buffer")),y=g(e("../rx-schema")),_=g(e("../pouch-db")),m=g(e("../rx-error"));function g(e){return e&&e.__esModule?e:{default:e}}var w=new WeakMap,x=new WeakMap,k={new_edits:!1},j=r.InMemoryRxCollection=function(e){(0,c.default)(t,e);function t(e,r){(0,a.default)(this,t);var o=(0,s.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.database,e.name,function(e){var t=(0,l.default)(e.jsonID);t.disableKeyCompression=!0,delete t.properties._id,delete t.properties._rev,delete t.properties._attachments;return function e(t,r){delete t.encrypted,Object.values(t).filter(function(e){return"object"===(void 0===e?"undefined":(0,n.default)(e))}).forEach(function(t){return e(t,r)})}(t,t),y.default.create(t)}(e.schema),r,{},e._methods));return o._isInMemory=!0,o._parentCollection=e,o._parentCollection.onDestroy.then(function(){return o.destroy()}),o._changeStreams=[],o.onDestroy.then(function(){o._changeStreams.forEach(function(e){return e.cancel()}),o.pouch.destroy()}),o}return(0,u.default)(t,[{key:"prepare",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._crypter=b.default.create(this.database.password,this.schema),this.pouch=new _.default("rxdb-in-memory-"+p.randomCouchString(10),p.adapterObject("memory"),{}),this._observable$=new d.Subject,this._changeEventBuffer=v.default.create(this),e.next=6,Promise.all(this.schema.indexes.map(function(e){return t.pouch.createIndex({index:{fields:e}})}));case 6:return this._subs.push(this._observable$.subscribe(function(e){var r=t._docCache.get(e.data.doc);r&&r._handleChangeEvent(e)})),e.next=9,this._initialSync();case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_initialSync",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t,r,n,a=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._parentCollection.pouch.allDocs({attachments:!1,include_docs:!0});case 2:return t=e.sent,e.next=5,this.pouch.bulkDocs({docs:t.rows.map(function(e){return e.doc}).filter(function(e){return!e.language}).map(function(e){return a._parentCollection._handleFromPouch(e)}).map(function(e){return a._parentCollection.schema.swapPrimaryToId(e)})},k);case 5:this._parentCollection.watchForChanges(),this.watchForChanges(),r=this.pouch.changes({since:"now",include_docs:!0,live:!0}).on("change",function(){var e=(0,i.default)(o.default.mark(function e(t){var r;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=a._parentCollection._handleToPouch(t.doc),a._parentCollection.pouch.bulkDocs({docs:[r]},k);case 2:case"end":return e.stop()}},e,a)}));return function(t){return e.apply(this,arguments)}}()),this._changeStreams.push(r),n=this._parentCollection.pouch.changes({since:"now",include_docs:!0,live:!0}).on("change",function(){var e=(0,i.default)(o.default.mark(function e(t){var r;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=a._parentCollection._handleFromPouch(t.doc),r=a.schema.swapPrimaryToId(r),a.pouch.bulkDocs({docs:[r]},k);case 3:case"end":return e.stop()}},e,a)}));return function(t){return e.apply(this,arguments)}}()),this._changeStreams.push(n);case 11:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"$emit",value:function(e){this._observable$.next(e),this._eventCounter||(this._eventCounter=0),this._eventCounter++,10===this._eventCounter&&(this._eventCounter=0,this.pouch.compact())}}]),t}(h.default.RxCollection);var O=!1,S=r.rxdb=!0,E=r.prototypes={RxCollection:function(e){e.inMemory=f}},C=r.overwritable={};r.default={rxdb:S,prototypes:E,overwritable:C,spawnInMemory:f}},{"../change-event-buffer":2,"../crypter":4,"../pouch-db":26,"../rx-collection":31,"../rx-error":34,"../rx-schema":36,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,clone:60,"rxjs/Subject":557}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=void 0;var n=c(e("babel-runtime/regenerator")),o=c(e("babel-runtime/helpers/asyncToGenerator")),i=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util")),a=c(e("../rx-query")),u=c(e("../rx-error")),s=c(e("../rx-change-event"));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,o=this,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t={name:this.name,instanceToken:this.token,encrypted:!1,passwordHash:null,collections:[]},this.password&&(t.passwordHash=i.hash(this.password),t.encrypted=!a),r=Object.keys(this.collections).filter(function(e){return!u||u.includes(e)}).filter(function(e){return"_"!==e.charAt(0)}).map(function(e){return o.collections[e]}),e.next=5,Promise.all(r.map(function(e){return e.dump(a)}));case 5:return t.collections=e.sent,e.abrupt("return",t);case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),l=function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=t.collections.filter(function(e){return!o.collections[e.name]}).map(function(e){return e.name})).length>0)){e.next=3;break}throw u.default.newRxError("JD1",{missingCollections:r});case 3:return e.abrupt("return",Promise.all(t.collections.map(function(e){return o.collections[e.name].importDump(e)})));case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,o,u,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=!s,r={name:this.name,schemaHash:this.schema.hash,encrypted:!1,passwordHash:null,docs:[]},this.database.password&&t&&(r.passwordHash=i.hash(this.database.password),r.encrypted=!0),o=a.default.create("find",{},this),e.next=6,this._pouchFind(o,null,t);case 6:return u=e.sent,r.docs=u.map(function(e){return delete e._rev,e}),e.abrupt("return",r);case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),h=function(){var e=(0,o.default)(n.default.mark(function e(t){var r,a=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.schemaHash===this.schema.hash){e.next=2;break}throw u.default.newRxError("JD2",{schemaHash:t.schemaHash,own:this.schema.hash});case 2:if(!t.encrypted||t.passwordHash===i.hash(this.database.password)){e.next=4;break}throw u.default.newRxError("JD3",{passwordHash:t.passwordHash,own:i.hash(this.database.password)});case 4:return r=t.docs.map(function(e){return a._crypter.decrypt(e)}).map(function(e){return a.schema.validate(e)}).map(function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a._pouchPut(t);case 2:r=t[a.schema.primaryPath],(o=s.default.create("INSERT",a.database,a,null,t)).data.doc=r,a.$emit(o);case 6:case"end":return e.stop()}},e,a)}));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",Promise.all(r));case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),p=r.rxdb=!0,b=r.prototypes={RxDatabase:function(e){e.dump=f,e.importDump=l},RxCollection:function(e){e.dump=d,e.importDump=h}},v=r.overwritable={};r.default={rxdb:p,prototypes:b,overwritable:v}},{"../rx-change-event":30,"../rx-error":34,"../rx-query":35,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/regenerator":57}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=void 0;var n=s(e("babel-runtime/helpers/typeof")),o=s(e("babel-runtime/helpers/classCallCheck")),i=s(e("babel-runtime/helpers/createClass"));r.create=f;var a=s(e("clone")),u=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util"));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(t){(0,o.default)(this,e),this.schema=t,this._table,this._reverseTable,this._fullTable}return(0,i.default)(e,[{key:"_compressObj",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o={};return"object"!==(void 0===e?"undefined":(0,n.default)(e))||null===e?e:Array.isArray(e)?e.map(function(e){return t._compressObj(e,u.trimDots(r+".item"))}):(Object.keys(e).forEach(function(n){var i=e[n],a=u.trimDots(r+"."+n),s=t.table[a]?t.table[a]:n,c=i;c=t._compressObj(i,a),o[s]=c}),o)}},{key:"compress",value:function(e){return this.schema.doKeyCompression()?this._compressObj(e):(0,a.default)(e)}},{key:"_decompressObj",value:function(e){var t=this,r=this.reverseTable;if("object"!==(void 0===e?"undefined":(0,n.default)(e))||null===e)return e;if(Array.isArray(e))return e.map(function(e){return t._decompressObj(e)});var o={};return Object.keys(e).forEach(function(n){var i=n;(n.startsWith("|")||n.startsWith("_"))&&r[n]&&(i=r[n]),o[i]=t._decompressObj(e[n])}),o}},{key:"decompress",value:function(e){if(!this.schema.doKeyCompression())return(0,a.default)(e);return this._decompressObj(e)}},{key:"_transformKey",value:function(e,t,r){var n=this.table;e=u.trimDots(e),t=u.trimDots(t);var o=r.shift(),i=u.trimDots(e+"."+o);return n[i]?t+="."+n[i]:t+="."+o,r.length>0?this._transformKey(i,t,r):u.trimDots(t)}},{key:"compressQuery",value:function(e){var t=this;if(e=(0,a.default)(e),!this.schema.doKeyCompression())return e;var r={};return Object.keys(e.selector).forEach(function(n){var o=e.selector[n];if(n.startsWith("$")){var i=o.map(function(e){var r={};return Object.keys(e).forEach(function(n){var o=t._transformKey("","",n.split("."));r[o]=e[n]}),r});r[n]=i}else{var a=t._transformKey("","",n.split("."));r[a]=o}}),e.selector=r,e.sort&&(e.sort=e.sort.map(function(e){var r=Object.keys(e)[0],n=e[r],o={};return o[t._transformKey("","",r.split("."))]=n,o})),e}},{key:"table",get:function(){var e=this;if(!this._table){var t=0;this._table={};!function r(o,i){Object.keys(i).map(function(a){var s=i[a],c="properties"===a?o:u.trimDots(o+"."+a);"object"===(void 0===s?"undefined":(0,n.default)(s))&&!Array.isArray(s)&&!e._table[c]&&""!==c&&a.length>3&&!c.startsWith("_")&&(e._table[c]="|"+(t++,u.numberToLetter(t-1))),!0===s.primary&&(e._table[c]="_id"),"object"!==(void 0===s?"undefined":(0,n.default)(s))||Array.isArray(s)||r(c,s)})}("",this.schema.normalized)}return this._table}},{key:"reverseTable",get:function(){var e=this;if(!this._reverseTable){var t=this.table;this._reverseTable={},Object.keys(t).forEach(function(r){var n=t[r],o=r.split(".").pop();e._reverseTable[n]=o})}return this._reverseTable}}]),e}();function f(e){return new c(e)}var l=r.rxdb=!0,d=r.prototypes={},h=r.overwritable={createKeyCompressor:f};r.default={rxdb:l,prototypes:d,overwritable:h}},{"../util":38,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/typeof":56,clone:60}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=r.SIGNAL_TIME=r.documentID=void 0;var n=p(e("babel-runtime/regenerator")),o=p(e("babel-runtime/helpers/asyncToGenerator")),i=p(e("babel-runtime/helpers/classCallCheck")),a=p(e("babel-runtime/helpers/createClass"));r.create=_;var u=p(e("unload")),s=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util")),c=p(e("../rx-broadcast-channel")),f=p(e("../rx-error")),l=e("rxjs/BehaviorSubject"),d=e("rxjs/operators/filter"),h=e("rxjs/operators/first");function p(e){return e&&e.__esModule?e:{default:e}}var b=r.documentID="_local/leader",v=r.SIGNAL_TIME=500,y=function(){function e(t){(0,i.default)(this,e),this.destroyed=!1,this.subs=[],this.unloads=[],this.database=t,this.token=this.database.token,this.isLeader=!1,this.becomeLeader$=new l.BehaviorSubject({isLeader:!1}),this.isDead=!1,this.isApplying=!1,this.isWaiting=!1,this.bc=c.default.create(this.database,"leader"),this.electionChannel=this.bc?"broadcast":"socket"}return(0,a.default)(e,[{key:"createLeaderObject",value:function(){return{_id:b,is:"",apply:"",t:0}}},{key:"getLeaderObject",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=void 0,e.prev=1,e.next=4,this.database._adminPouch.get(b);case 4:t=e.sent,e.next=14;break;case 7:return e.prev=7,e.t0=e.catch(1),t=this.createLeaderObject(),e.next=12,this.database._adminPouch.put(t);case 12:r=e.sent,t._rev=r.rev;case 14:return e.abrupt("return",t);case 15:case"end":return e.stop()}},e,this,[[1,7]])}));return function(){return e.apply(this,arguments)}}()},{key:"setLeaderObject",value:function(e){return this.database._adminPouch.put(e)}},{key:"getApplyFunction",value:function(e){if("socket"===e)return this.applySocket.bind(this);if("broadcast"===e)return this.applyBroadcast.bind(this);throw f.default.newRxError("LE1")}},{key:"applyOnce",value:function(){var e=(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isLeader){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.isDead){e.next=4;break}return e.abrupt("return",!1);case 4:if(!this.isApplying){e.next=6;break}return e.abrupt("return",!1);case 6:if(!this.destroyed){e.next=8;break}return e.abrupt("return",!1);case 8:return this.isApplying=!0,e.next=11,this.getApplyFunction(this.electionChannel)();case 11:if(!e.sent){e.next=15;break}return e.next=15,this.beLeader();case 15:return this.isApplying=!1,e.abrupt("return",!0);case 17:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"applySocket",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getLeaderObject();case 3:if(t=e.sent,r=(new Date).getTime()-2*v,!(t.t>=r)){e.next=7;break}throw f.default.newRxError("LE2");case 7:return t.apply=this.token,t.t=(new Date).getTime(),e.next=11,this.setLeaderObject(t);case 11:return e.next=13,s.promiseWait(.5*v);case 13:return e.next=15,this.getLeaderObject();case 15:if((t=e.sent).apply===this.token){e.next=18;break}throw f.default.newRxError("LE3");case 18:return e.abrupt("return",!0);case 21:return e.prev=21,e.t0=e.catch(0),e.abrupt("return",!1);case 24:case"end":return e.stop()}},e,this,[[0,21]])}));return function(){return e.apply(this,arguments)}}()},{key:"applyBroadcast",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,i,a,u,c=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),r=[],i=[],a=function(){var e=(0,o.default)(n.default.mark(function e(){var o;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.push(c.bc.$.pipe((0,d.filter)(function(){return!!c.isApplying}),(0,d.filter)(function(e){return e.t>=t}),(0,d.filter)(function(e){return"apply"===e.type}),(0,d.filter)(function(e){return e.datac.token}),(0,d.filter)(function(){return i.length<1})).subscribe(function(e){return i.push("other is applying:"+e.it)})),r.push(c.bc.$.pipe((0,d.filter)(function(){return!!c.isApplying}),(0,d.filter)(function(e){return e.t>=t}),(0,d.filter)(function(e){return"tell"===e.type}),(0,d.filter)(function(){return i.length<1})).subscribe(function(e){return i.push("other is leader"+e.it)})),r.push(c.bc.$.pipe((0,d.filter)(function(){return!!c.isApplying}),(0,d.filter)(function(e){return"apply"===e.type}),(0,d.filter)(function(e){return e.data>t||e.data===t&&e.it>c.token})).subscribe(function(){return c.bc.write("apply",t)})),o=3;case 4:if(!(o>0)){e.next=14;break}return o--,e.next=8,c.bc.write("apply",t);case 8:return e.next=10,s.promiseWait(300);case 10:if(!(i.length>0)){e.next=12;break}return e.abrupt("return",!1);case 12:e.next=4;break;case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}},e,c)}));return function(){return e.apply(this,arguments)}}(),e.next=6,a();case 6:return u=e.sent,r.map(function(e){return e.unsubscribe()}),e.abrupt("return",u);case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"leaderSignal",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(!this.leaderSignal_run){e.next=4;break}return e.abrupt("return");case 4:this.leaderSignal_run=!0,e.t0=this.electionChannel,e.next="broadcast"===e.t0?8:"socket"===e.t0?11:31;break;case 8:return e.next=10,this.bc.write("tell");case 10:return e.abrupt("break",31);case 11:t=!1;case 12:if(t){e.next=30;break}return e.prev=13,e.next=16,this.getLeaderObject();case 16:return(r=e.sent).is=this.token,r.apply=this.token,r.t=(new Date).getTime(),e.next=22,this.setLeaderObject(r);case 22:t=!0,e.next=28;break;case 25:e.prev=25,e.t1=e.catch(13),console.dir(e.t1);case 28:e.next=12;break;case 30:return e.abrupt("break",31);case 31:return this.leaderSignal_run=!1,e.abrupt("return");case 33:case"end":return e.stop()}},e,this,[[13,25]])}));return function(){return e.apply(this,arguments)}}()},{key:"beLeader",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isDead){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.isLeader){e.next=4;break}return e.abrupt("return",!1);case 4:return this.isLeader=!0,this.becomeLeader$.next({isLeader:!0}),e.next=8,this.leaderSignal();case 8:e.t0=this.electionChannel,e.next="broadcast"===e.t0?11:"socket"===e.t0?14:16;break;case 11:return this.signalLeadership=this.bc.$.pipe((0,d.filter)(function(){return!!t.isLeader}),(0,d.filter)(function(e){return"tell"!==e.type})).subscribe(function(){return t.leaderSignal()}),this.subs.push(this.signalLeadership),e.abrupt("break",16);case 14:return(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.destroyed){e.next=9;break}return e.next=3,s.promiseWait(v);case 3:if(t.isLeader){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,t.leaderSignal();case 7:e.next=0;break;case 9:case"end":return e.stop()}},e,t)}))(),e.abrupt("break",16);case 16:return this.unloads.push(u.default.add(function(){t.bc&&t.bc.write("death"),t.die()})),e.abrupt("return",!0);case 18:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"die",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isLeader){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.isDead){e.next=4;break}return e.abrupt("return",!1);case 4:this.isDead=!0,this.isLeader=!1,this.signalLeadership&&this.signalLeadership.unsubscribe(),e.t0=this.electionChannel,e.next="broadcast"===e.t0?10:"socket"===e.t0?13:30;break;case 10:return e.next=12,this.bc.write("death");case 12:return e.abrupt("break",30);case 13:t=!1;case 14:if(t){e.next=29;break}return e.prev=15,e.next=18,this.getLeaderObject();case 18:return(r=e.sent).t=0,e.next=22,this.setLeaderObject(r);case 22:t=!0,e.next=27;break;case 25:e.prev=25,e.t1=e.catch(15);case 27:e.next=14;break;case 29:return e.abrupt("break",30);case 30:return e.abrupt("return",!0);case 31:case"end":return e.stop()}},e,this,[[15,25]])}));return function(){return e.apply(this,arguments)}}()},{key:"waitForLeadership",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isLeader){e.next=2;break}return e.abrupt("return",Promise.resolve(!0));case 2:if(this.isWaiting){e.next=14;break}this.isWaiting=!0,this.applyOnce(),t=5*v,e.t0=this.electionChannel,e.next="broadcast"===e.t0?9:"socket"===e.t0?11:13;break;case 9:return this.subs.push(this.bc.$.pipe((0,d.filter)(function(e){return"death"===e.type})).subscribe(function(){return r.applyOnce()})),e.abrupt("break",13);case 11:return t=2*v,e.abrupt("break",13);case 13:(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r.destroyed||r.isLeader){e.next=16;break}return e.next=3,s.promiseWait(t);case 3:e.t0=r.electionChannel,e.next="broadcast"===e.t0?6:"socket"===e.t0?9:12;break;case 6:return e.next=8,s.requestIdlePromise(t);case 8:return e.abrupt("break",12);case 9:return e.next=11,r.database.requestIdlePromise(t);case 11:return e.abrupt("break",12);case 12:return e.next=14,r.applyOnce();case 14:e.next=0;break;case 16:case"end":return e.stop()}},e,r)}))();case 14:return e.abrupt("return",this.becomeLeader$.asObservable().pipe((0,d.filter)(function(e){return!0===e.isLeader}),(0,h.first)()).toPromise());case 15:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){var e=(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.destroyed=!0,this.subs.map(function(e){return e.unsubscribe()}),this.unloads.map(function(e){return e()}),e.next=5,this.die();case 5:this.bc&&this.bc.destroy();case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function _(e){return new y(e)}var m=r.rxdb=!0,g=r.prototypes={},w=r.overwritable={createLeaderElector:_};r.default={rxdb:m,prototypes:g,overwritable:w}},{"../rx-broadcast-channel":29,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,"rxjs/BehaviorSubject":550,"rxjs/operators/filter":569,"rxjs/operators/first":570,unload:601}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=r.RxLocalDocument=void 0;var n=m(e("babel-runtime/regenerator")),o=m(e("babel-runtime/helpers/asyncToGenerator")),i=m(e("babel-runtime/helpers/classCallCheck")),a=m(e("babel-runtime/helpers/createClass")),u=m(e("babel-runtime/helpers/possibleConstructorReturn")),s=m(e("babel-runtime/helpers/inherits")),c=m(e("clone")),f=m(e("object-path")),l=m(e("deep-equal")),d=m(e("../rx-document")),h=m(e("../rx-database")),p=m(e("../rx-collection")),b=m(e("../rx-change-event")),v=m(e("../doc-cache")),y=m(e("../rx-error")),_=e("rxjs/operators/filter");function m(e){return e&&e.__esModule?e:{default:e}}var g=new WeakMap,w=function(e){return g.has(e)||g.set(e,v.default.create()),g.get(e)},x=new WeakMap,k="_local/",j=r.RxLocalDocument=function(e){(0,s.default)(t,e);function t(e,r,n){(0,i.default)(this,t);var o=(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,null,r));return o.id=e,o.parent=n,o}return(0,a.default)(t,[{key:"toPouchJson",value:function(){(0,c.default)(this._data)._id=k+this.id}},{key:"_handleChangeEvent",value:function(e){if(e.data.doc===this.primary)switch(e.data.op){case"UPDATE":var t=(0,c.default)(e.data.v),r=this._dataSync$.getValue(),n=this._data;(0,l.default)(r,n)?(this._data=t,!0!==this._synced$.getValue()&&this._synced$.next(!0)):(!1!==this._synced$.getValue()&&this._synced$.next(!1),this._data._rev=t._rev),this._dataSync$.next((0,c.default)(t));break;case"REMOVE":w(this.parent).delete(this.primary),this._deleted$.next(!0)}}},{key:"$emit",value:function(e){return this.parent.$emit(e)}},{key:"get",value:function(e){if(this._data){if("string"!=typeof e)throw y.default.newRxTypeError("LD2",{objPath:e});var t=f.default.get(this._data,e);return t=(0,c.default)(t)}}},{key:"get$",value:function(e){if(e.includes(".item."))throw y.default.newRxError("LD3",{path:e});if(e===this.primaryPath)throw y.default.newRxError("LD4");return this._dataSync$.map(function(t){return f.default.get(t,e)}).distinctUntilChanged().asObservable()}},{key:"set",value:function(e,t){if(!t){var r=(0,c.default)(e);return r._rev=this._data._rev,this._data=r,this}if("_id"===e)throw y.default.newRxError("LD5",{objPath:e,value:t});if(!Object.is(this.get(e),t))return f.default.set(this._data,e,t),this}},{key:"save",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,o;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(t=(0,c.default)(this._data))._id=k+this.id,e.next=4,this.parentPouch.put(t);case 4:r=e.sent,this._data._rev=r.rev,o=b.default.create("UPDATE",h.default.isInstanceOf(this.parent)?this.parent:this.parent.database,p.default.isInstanceOf(this.parent)?this.parent:null,this,(0,c.default)(this._data),!0),this.$emit(o);case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=k+this.id,e.next=3,this.parentPouch.remove(t,this._data._rev);case 3:w(this.parent).delete(this.id),r=b.default.create("REMOVE",h.default.isInstanceOf(this.parent)?this.parent:this.parent.database,p.default.isInstanceOf(this.parent)?this.parent:null,this,(0,c.default)(this._data),!0),this.$emit(r);case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"isLocal",get:function(){return!0}},{key:"parentPouch",get:function(){return E(this.parent)}},{key:"allAttachments$",get:function(){throw y.default.newRxError("LD1",{document:this})}},{key:"primaryPath",get:function(){return"id"}},{key:"primary",get:function(){return this.id}},{key:"$",get:function(){return this._dataSync$.asObservable()}}]),t}(d.default.RxDocument),O=!1,S=function(){if(!O){O=!0;["populate","update","putAttachment","getAttachment","allAttachments"].forEach(function(e){return j.prototype[e]=(t=e,function(){throw y.default.newRxError("LD6",{functionName:t})});var t})}};j.create=function(e,t,r){S(),function(e){if(!x.has(e)){var t=e.$.pipe((0,_.filter)(function(e){return e.data.isLocal})).subscribe(function(t){var r=w(e).get(t.data.doc);r&&r._handleChangeEvent(t)});e._subs.push(t),x.set(e,t)}x.get(e)}(r);var n=new j(e,t,r);return w(r).set(e,n),n};var E=function(e){return h.default.isInstanceOf(e)?e._adminPouch:e.pouch},C=function(){var e=(0,o.default)(n.default.mark(function e(t,r){var o,i,a,u;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.default.isInstanceOf(this)||!this._isInMemory){e.next=2;break}return e.abrupt("return",this._parentCollection.insertLocal(t,r));case 2:return r=(0,c.default)(r),e.next=5,this.getLocal(t);case 5:if(!e.sent){e.next=8;break}throw y.default.newRxError("LD7",{id:t,data:r});case 8:return o=E(this),(i=(0,c.default)(r))._id=k+t,e.next=13,o.put(i);case 13:return a=e.sent,r._rev=a.rev,u=j.create(t,r,this),e.abrupt("return",u);case 17:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),A=function(){var e=(0,o.default)(n.default.mark(function e(t,r){var o,i;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.default.isInstanceOf(this)||!this._isInMemory){e.next=2;break}return e.abrupt("return",this._parentCollection.upsertLocal(t,r));case 2:return e.next=4,this.getLocal(t);case 4:if(o=e.sent){e.next=10;break}return i=this.insertLocal(t,r),e.abrupt("return",i);case 10:return r._rev=o._data._rev,o._data=r,e.next=14,o.save();case 14:return e.abrupt("return",o);case 15:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),P=function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o,i,a,u;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.default.isInstanceOf(this)||!this._isInMemory){e.next=2;break}return e.abrupt("return",this._parentCollection.getLocal(t));case 2:if(r=E(this),o=w(this),i=o.get(t)){e.next=19;break}return e.prev=6,e.next=9,r.get(k+t);case 9:if(a=e.sent){e.next=12;break}return e.abrupt("return",null);case 12:return u=j.create(t,a,this),e.abrupt("return",u);case 16:return e.prev=16,e.t0=e.catch(6),e.abrupt("return",null);case 19:return e.abrupt("return",i);case 20:case"end":return e.stop()}},e,this,[[6,16]])}));return function(t){return e.apply(this,arguments)}}(),R=r.rxdb=!0,D=r.prototypes={RxCollection:function(e){e.insertLocal=C,e.upsertLocal=A,e.getLocal=P},RxDatabase:function(e){e.insertLocal=C,e.upsertLocal=A,e.getLocal=P}},M=r.overwritable={};r.default={rxdb:R,prototypes:D,overwritable:M}},{"../doc-cache":6,"../rx-change-event":30,"../rx-collection":31,"../rx-database":32,"../rx-document":33,"../rx-error":34,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54,"babel-runtime/regenerator":57,clone:60,"deep-equal":488,"object-path":503,"rxjs/operators/filter":569}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.overwritable=r.prototypes=r.rxdb=r.RxReplicationState=void 0;var n=g(e("babel-runtime/regenerator")),o=g(e("babel-runtime/helpers/asyncToGenerator")),i=g(e("babel-runtime/helpers/classCallCheck")),a=g(e("babel-runtime/helpers/createClass"));r.createRxReplicationState=x,r.watchForChanges=k,r.sync=j;var u=g(e("clone")),s=g(e("pouchdb-replication")),c=e("rxjs/Subject"),f=e("rxjs/BehaviorSubject"),l=e("rxjs/observable/fromEvent"),d=e("rxjs/operators/filter"),h=e("rxjs/operators/map"),p=e("rxjs/operators/delay"),b=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util")),v=g(e("../core")),y=g(e("../rx-collection")),_=g(e("../rx-change-event")),m=g(e("../rx-error"));function g(e){return e&&e.__esModule?e:{default:e}}v.default.plugin(s.default);var w=r.RxReplicationState=function(){function e(t){var r=this;(0,i.default)(this,e),this._subs=[],this.collection=t,this._pouchEventEmitterObject=null,this._subjects={change:new c.Subject,docs:new c.Subject,active:new f.BehaviorSubject(!1),complete:new f.BehaviorSubject(!1),error:new c.Subject},Object.keys(this._subjects).forEach(function(e){Object.defineProperty(r,e+"$",{get:function(){return this._subjects[e].asObservable()}})})}return(0,a.default)(e,[{key:"setPouchEventEmitter",value:function(e){var t=this;if(this._pouchEventEmitterObject)throw m.default.newRxError("RC1");this._pouchEventEmitterObject=e,this._subs.push((0,l.fromEvent)(e,"change").subscribe(function(e){return t._subjects.change.next(e)})),this._subs.push((0,l.fromEvent)(e,"change").subscribe(function(e){0!==t._subjects.docs.observers.length&&"pull"===e.direction&&e.change.docs.filter(function(e){return"query"!==e.language}).map(function(e){return t.collection._handleFromPouch(e)}).forEach(function(e){return t._subjects.docs.next(e)})})),this._subs.push((0,l.fromEvent)(e,"error").subscribe(function(e){return t._subjects.error.next(e)})),this._subs.push((0,l.fromEvent)(e,"active").subscribe(function(){return t._subjects.active.next(!0)})),this._subs.push((0,l.fromEvent)(e,"paused").subscribe(function(){return t._subjects.active.next(!1)})),this._subs.push((0,l.fromEvent)(e,"complete").subscribe(function(e){return t._subjects.complete.next(e)}))}},{key:"cancel",value:function(){var e=(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._pouchEventEmitterObject&&this._pouchEventEmitterObject.cancel(),this._subs.forEach(function(e){return e.unsubscribe()});case 2:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function x(e){return new w(e)}function k(){var e=this;if(!this.synced){var t={},r=(0,l.fromEvent)(this.pouch.changes({since:"now",live:!0,include_docs:!0}),"change").pipe((0,d.filter)(function(e){return"_"!==e.id.charAt(0)}),(0,h.map)(function(e){return e.doc}),(0,d.filter)(function(t){return!e._changeEventBuffer.buffer.map(function(e){return e.data.v._rev}).includes(t._rev)}),(0,d.filter)(function(e){return t[e._rev]="YES"}),(0,p.delay)(10),(0,h.map)(function(e){var r=null;return"YES"===t[e._rev]&&(r=e),delete t[e._rev],r}),(0,d.filter)(function(e){return null!==e})).subscribe(function(t){e.$emit(_.default.fromPouchChange(t,e))});this._subs.push(r);var n=this.$.pipe((0,h.map)(function(e){return e.data.v}),(0,h.map)(function(e){e&&t[e._rev]&&(t[e._rev]="NO")})).subscribe();this._subs.push(n),this.synced=!0}}function j(e){var t=this,r=e.remote,i=e.waitForLeadership,a=void 0===i||i,s=e.direction,c=void 0===s?{pull:!0,push:!0}:s,f=e.options,l=void 0===f?{live:!0,retry:!0}:f,d=e.query;if(l=(0,u.default)(l),y.default.isInstanceOf(r)&&(r=r.pouch),d&&this!==d.collection)throw m.default.newRxError("RC2",{query:d});var h=b.pouchReplicationFunction(this.pouch,c);d&&(l.selector=d.keyCompress().selector);var p=x(this);return(0,o.default)(n.default.mark(function e(){var o;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=5;break}return e.next=3,t.database.waitForLeadership();case 3:e.next=7;break;case 5:return e.next=7,b.promiseWait(0);case 7:o=h(r,l),t.watchForChanges(),p.setPouchEventEmitter(o),t._repStates.push(p);case 11:case"end":return e.stop()}},e,t)}))(),p}var O=r.rxdb=!0,S=r.prototypes={RxCollection:function(e){e.watchForChanges=k,e.sync=j}},E=r.overwritable={};r.default={rxdb:O,prototypes:S,overwritable:E,watchForChanges:k,sync:j}},{"../core":3,"../rx-change-event":30,"../rx-collection":31,"../rx-error":34,"../util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/regenerator":57,clone:60,"pouchdb-replication":539,"rxjs/BehaviorSubject":550,"rxjs/Subject":557,"rxjs/observable/fromEvent":565,"rxjs/operators/delay":567,"rxjs/operators/filter":569,"rxjs/operators/map":571}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.hooks=r.rxdb=void 0;var n=s(e("babel-runtime/helpers/typeof"));r.checkFieldNameRegex=c,r.validateFieldsDeep=f,r.checkSchema=l;var o=s(e("object-path")),i=s(e("../rx-document")),a=s(e("../rx-error")),u=e("../rx-schema");function s(e){return e&&e.__esModule?e:{default:e}}function c(e){if(""!==e){if(["properties","language"].includes(e))throw a.default.newRxError("SC23",{fieldName:e});var t="^[a-zA-Z][[a-zA-Z0-9_]*]?[a-zA-Z0-9]$",r=new RegExp(t);if(!e.match(r))throw a.default.newRxError("SC1",{regex:t,fieldName:e})}}function f(e){function t(e,t,r){if("string"!=typeof e||"object"!==(void 0===t?"undefined":(0,n.default)(t))||Array.isArray(t)||c(e),t.hasOwnProperty("item")&&"array"!==t.type)throw a.default.newRxError("SC2",{fieldName:e});if(t.hasOwnProperty("ref"))switch(t.type){case"string":break;case"array":if(!t.items||!t.items.type||"string"!==t.items.type)throw a.default.newRxError("SC3",{fieldName:e});break;default:throw a.default.newRxError("SC4",{fieldName:e})}if(t.hasOwnProperty("ref")&&t.primary)throw a.default.newRxError("SC5",{fieldName:e});var o=r.split(".").length>=2;if(o){if(t.primary)throw a.default.newRxError("SC6",{path:r,primary:t.primary});if(t.default)throw a.default.newRxError("SC7",{path:r})}if(!o&&"_"===e.charAt(0))throw a.default.newRxError("SC8",{fieldName:e})}return function e(r,o){if("object"===(void 0===r?"undefined":(0,n.default)(r)))for(var i in r){r.properties||t(i,r[i],o);var a=o;"properties"!==i&&(a=a+"."+i),e(r[i],a)}}(e,""),!0}function l(e){if(e.properties._id)throw a.default.newRxError("SC9",{schema:e});if(e.properties._rev)throw a.default.newRxError("SC10",{schema:e});if(!e.hasOwnProperty("version")||"number"!=typeof e.version||e.version<0)throw a.default.newRxError("SC11",{version:e.version});f(e);var t=void 0;if(Object.keys(e.properties).forEach(function(r){var n=e.properties[r];if(n.primary){if(t)throw a.default.newRxError("SC12",{value:n});if(t=r,n.index)throw a.default.newRxError("SC13",{value:n});if(n.unique)throw a.default.newRxError("SC14",{value:n});if(n.encrypted)throw a.default.newRxError("SC15",{value:n});if("string"!==n.type)throw a.default.newRxError("SC16",{value:n})}if(i.default.properties().includes(r))throw a.default.newRxError("SC17",{key:r})}),e.compoundIndexes){if(!Array.isArray(e.compoundIndexes))throw a.default.newRxError("SC18",{compoundIndexes:e.compoundIndexes});e.compoundIndexes.forEach(function(t){if(!Array.isArray(t))throw a.default.newRxError("SC19",{compoundIndexes:e.compoundIndexes});t.forEach(function(t){if("string"!=typeof t)throw a.default.newRxError("SC20",{compoundIndexes:e.compoundIndexes})})})}(0,u.getIndexes)(e).reduce(function(e,t){return e.concat(t)},[]).filter(function(e,t,r){return r.indexOf(e)===t}).map(function(t){var r=o.default.get(e,"properties."+t.replace(".",".properties."));if(!r||"object"!==(void 0===r?"undefined":(0,n.default)(r)))throw a.default.newRxError("SC21",{key:t});return{key:t,schemaObj:r}}).filter(function(e){return"string"!==e.schemaObj.type&&"integer"!==e.schemaObj.type&&"number"!==e.schemaObj.type}).forEach(function(e){throw a.default.newRxError("SC22",{key:e.key,type:e.schemaObj.type})})}var d=r.rxdb=!0,h=r.hooks={preCreateRxSchema:l};r.default={rxdb:d,hooks:h}},{"../rx-document":33,"../rx-error":34,"../rx-schema":36,"babel-runtime/helpers/typeof":56,"object-path":503}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.prototypes=r.rxdb=r.RxQueryUpdate=void 0;var n=s(e("babel-runtime/regenerator")),o=s(e("babel-runtime/helpers/asyncToGenerator")),i=r.RxQueryUpdate=function(){var e=(0,o.default)(n.default.mark(function e(t){var r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.exec();case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:if(!Array.isArray(r)){e.next=10;break}return e.next=8,Promise.all(r.map(function(e){return e.update(t)}));case 8:e.next=12;break;case 10:return e.next=12,r.update(t);case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}();r.update=c;var a=s(e("modifyjs")),u=s(e("deep-equal"));function s(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=this,r=(0,a.default)(this._data,e);return Object.keys(this._data).forEach(function(e){r[e]?(0,u.default)(t._data[e],r[e])||(t._data[e]=r[e]):delete t._data[e]}),delete r._rev,delete r._id,Object.keys(r).filter(function(e){return!(0,u.default)(t._data[e],r[e])}).forEach(function(e){return t._data[e]=r[e]}),this.save()}var f=r.rxdb=!0,l=r.prototypes={RxDocument:function(e){e.update=c},RxQuery:function(e){e.update=i}};r.default={rxdb:f,prototypes:l}},{"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/regenerator":57,"deep-equal":488,modifyjs:502}],25:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.hooks=r.prototypes=r.rxdb=void 0;var n=a(e("is-my-json-valid")),o=a(e("../rx-error")),i=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}var u={},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.hash;u[t]||(u[t]={});var r=u[t];if(!r[e]){var i=""===e?this.jsonID:this.getSchemaByObjectPath(e);if(!i)throw o.default.newRxError("VD1",{schemaPath:e});r[e]=(0,n.default)(i)}return r[e]},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this._getValidator(t);if(r(e))return e;throw o.default.newRxError("VD2",{errors:r.errors,schemaPath:t,obj:e,schema:this.jsonID})},f=r.rxdb=!0,l=r.prototypes={RxSchema:function(e){e._getValidator=s,e.validate=c}},d=r.hooks={createRxSchema:function(e){i.requestIdleCallbackIfAvailable(function(){e._getValidator()})}};r.default={rxdb:f,prototypes:l,hooks:d}},{"../rx-error":34,"../util":38,"is-my-json-valid":497}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("pouchdb-core")),o=a(e("pouchdb-find")),i=a(e("./rx-error"));function a(e){return e&&e.__esModule?e:{default:e}}n.default.plugin(o.default),n.default.countAllUndeleted=function(e){return e.allDocs({include_docs:!1,attachments:!1}).then(function(e){return e.rows.filter(function(e){return!e.id.startsWith("_design/")}).length})},n.default.getBatch=function(e,t){if(t<=1)throw i.default.newRxError("P1",{limit:t});return e.allDocs({include_docs:!0,attachments:!1,limit:t}).then(function(e){return e.rows.map(function(e){return e.doc}).filter(function(e){return!e._id.startsWith("_design")})})},r.default=n.default},{"./rx-error":34,"pouchdb-core":522,"pouchdb-find":530}],27:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=i(e("babel-runtime/helpers/classCallCheck")),o=i(e("babel-runtime/helpers/createClass"));r.create=u;function i(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(){(0,n.default)(this,e),this.subs=[],this._map=new Map}return(0,o.default)(e,[{key:"getByQuery",value:function(e){var t=e.toString();return this._map.has(t)||this._map.set(t,e),this._map.get(t)}},{key:"destroy",value:function(){this.subs.forEach(function(e){return e.unsubscribe()}),this._map=new Map}}]),e}();function u(){return new a}r.default={create:u}},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=u(e("babel-runtime/helpers/classCallCheck")),o=u(e("babel-runtime/helpers/createClass"));r.enableDebugging=l,r.enable=d,r.create=h;var i=e("pouchdb-selector-core"),a=u(e("object-path"));function u(e){return e&&e.__esModule?e:{default:e}}var s=!1,c=!1,f=function(){function e(t){(0,n.default)(this,e),this.query=t,this.primaryKey=this.query.collection.schema.primaryPath}return(0,o.default)(e,[{key:"runChangeDetection",value:function(e){var t=this;if(0===e.length)return!1;if(!c)return!0;var r=this.query._resultsData,n=!1;return!!e.find(function(e){var o=t.handleSingleChange(r,e);return Array.isArray(o)?(n=!0,r=o,!1):!!o||void 0})||!!n&&r}},{key:"_debugMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"optimized";console.dir({name:"QueryChangeDetector",title:r,query:this.query.toString(),key:e,changeEventData:t})}},{key:"handleSingleChange",value:function(e,t){var r=this,n=e.slice(0),o=this.query.toJSON(),i=t.data.v,a=this._isDocInResultData(i,e),u=this.doesDocMatchQuery(i),c=!o.limit||o.limit&&e.length>=o.limit,f=o.limit&&e.length>=o.limit;s&&(console.log("QueryChangeDetector.handleSingleChange()"),this._debugMessage("start",t.data.v,"handleSingleChange()"),console.log("changeEvent.data:"),console.dir(t.data),console.log("wasDocInResults: "+a),console.log("doesMatchNow: "+u),console.log("isFilled: "+c));var l=null,d=null,h=null;if("REMOVE"===t.data.op){if(!u)return s&&this._debugMessage("R1",i),!1;if(o.skip&&u&&(null===d&&(d=r._isSortedBefore(i,n[0])),d)&&!c)return s&&this._debugMessage("R2",i),n.shift(),n;if(u&&a&&!c)return s&&this._debugMessage("R3",i),n=n.filter(function(e){return e[r.primaryKey]!==i[r.primaryKey]});if(u&&a&&!o.limit&&!o.skip)return s&&this._debugMessage("R3.1",i),n=n.filter(function(e){return e[r.primaryKey]!==i[r.primaryKey]});if(u&&o.limit&&(null===l&&(l=r._isSortedBefore(n[n.length-1],i)),l))return s&&this._debugMessage("R4",i),!1}else{if(!(o.skip||o.limit||a||u))return s&&this._debugMessage("U1",i),!1;if(!o.skip&&!o.limit&&a&&u){var p=n.find(function(e){return e[r.primaryKey]===i[r.primaryKey]}),b=n.indexOf(p);return n[b]=i,function(){if(null===h){var t=e.find(function(e){return e[r.primaryKey]===i[r.primaryKey]});h=r._sortFieldChanged(t,i)}return h}()?(s&&this._debugMessage("U2 - resort",i),this._resortDocData(n)):(s&&this._debugMessage("U2 - no-resort",i),n)}if(!o.skip&&!f&&!a&&u){s&&this._debugMessage("U3",i),n.push(i);return this._resortDocData(n)}}return!0}},{key:"doesDocMatchQuery",value:function(e){e=this.query.collection.schema.swapPrimaryToId(e);var t=Object.keys(this.query.toJSON().selector);return 1===(0,i.filterInMemoryFields)([{doc:e}],{selector:(0,i.massageSelector)(this.query.toJSON().selector)},t).length}},{key:"_isDocInResultData",value:function(e,t){var r=this.query.collection.schema.primaryPath;return!!t.find(function(t){return t[r]===e[r]})}},{key:"_sortFieldChanged",value:function(e,t){var r=!1;return this.query.toJSON().sort.map(function(e){return Object.keys(e).pop()}).find(function(n){return a.default.get(e,n)!==a.default.get(t,n)&&(r=!0,!0)}),r}},{key:"_isSortedBefore",value:function(e,t){var r=this.query.toJSON(),n=Object.keys(this.query.toJSON().selector),o=this.query.collection.schema.swapPrimaryToId(e),a=[o,this.query.collection.schema.swapPrimaryToId(t)].map(function(e){return{id:e._id,doc:e}});return(0,i.filterInMemoryFields)(a,{selector:(0,i.massageSelector)(this.query.toJSON().selector),sort:r.sort},n)[0].id===o._id}},{key:"_resortDocData",value:function(e){var t=this,r=e.map(function(e){return{doc:t.query.collection.schema.swapPrimaryToId(e)}}),n=this.query.toJSON(),o=Object.keys(this.query.toJSON().selector);return(0,i.filterInMemoryFields)(r,{selector:(0,i.massageSelector)(this.query.toJSON().selector),sort:n.sort},o).map(function(e){return e.doc}).map(function(e){return t.query.collection.schema.swapIdToPrimary(e)})}}]),e}();function l(){console.log("QueryChangeDetector.enableDebugging()"),s=!0}function d(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];console.log("QueryChangeDetector.enableDebugging("+e+")"),c=e}function h(e){return new f(e)}r.default={create:h,enableDebugging:l,enable:d}},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"object-path":503,"pouchdb-selector-core":541}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=c(e("babel-runtime/helpers/typeof")),o=c(e("babel-runtime/helpers/classCallCheck")),i=c(e("babel-runtime/helpers/createClass"));r.canIUse=d,r.create=h;var a=e("rxjs/observable/fromEvent"),u=e("rxjs/operators/map"),s=e("rxjs/operators/filter");function c(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(t,r){(0,o.default)(this,e),this.name=r,this.database=t,this.token=t.token}return(0,i.default)(e,[{key:"write",value:function(e,t){return this.bc.postMessage(JSON.stringify({type:e,it:this.token,data:t,t:(new Date).getTime()}))}},{key:"destroy",value:function(){this._bc&&this._bc.close()}},{key:"bc",get:function(){return this._bc||(this._bc=new BroadcastChannel("RxDB:"+this.database.name+":"+this.name)),this._bc}},{key:"$",get:function(){var e=this;return this._$||(this._$=(0,a.fromEvent)(this.bc,"message").pipe((0,u.map)(function(e){return e.data}),(0,u.map)(function(e){return JSON.parse(e)}),(0,s.filter)(function(t){return t.it!==e.token}))),this._$}}]),e}(),l=null;function d(){return null===l&&(l=!("object"!==("undefined"==typeof window?"undefined":(0,n.default)(window))||!window.BroadcastChannel||"function"!=typeof window.BroadcastChannel||"function"!=typeof window.BroadcastChannel.prototype.postMessage||"function"!=typeof window.BroadcastChannel.prototype.close)),l}function h(e,t){return d()?new f(e,t):null}r.default={create:h,canIUse:d}},{"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/typeof":56,"rxjs/observable/fromEvent":565,"rxjs/operators/filter":569,"rxjs/operators/map":571}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RxChangeEvent=void 0;var n=a(e("babel-runtime/helpers/classCallCheck")),o=a(e("babel-runtime/helpers/createClass"));r.fromJSON=s,r.fromPouchChange=c,r.create=f,r.isInstanceOf=l;var i=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util"));function a(e){return e&&e.__esModule?e:{default:e}}var u=r.RxChangeEvent=function(){function e(t){(0,n.default)(this,e),this.data=t}return(0,o.default)(e,[{key:"toJSON",value:function(){var e={op:this.data.op,t:this.data.t,db:this.data.db,it:this.data.it,isLocal:this.data.isLocal};return this.data.col&&(e.col=this.data.col),this.data.doc&&(e.doc=this.data.doc),this.data.v&&(e.v=this.data.v),e}},{key:"isIntern",value:function(){return!(!this.data.col||"_"!==this.data.col.charAt(0))}},{key:"isSocket",value:function(){return!(!this.data.col||"_socket"!==this.data.col)}},{key:"hash",get:function(){return this._hash||(this._hash=i.hash(this.data)),this._hash}}]),e}();function s(e){return new u(e)}function c(e,t){var r=e._rev.startsWith("1-")?"INSERT":"UPDATE";e._deleted&&(r="REMOVE"),e=t._handleFromPouch(e);var n={op:r,t:(new Date).getTime(),db:"remote",col:t.name,it:t.database.token,doc:e[t.schema.primaryPath],v:e};return new u(n)}function f(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a={op:e,t:(new Date).getTime(),db:t.name,it:t.token,isLocal:i};return r&&(a.col=r.name),n&&(a.doc=n.primary),o&&(a.v=o),new u(a)}function l(e){return e instanceof u}r.default={fromJSON:s,fromPouchChange:c,create:f,isInstanceOf:l}},{"./util":38,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.create=r.RxCollection=void 0;var n=O(e("babel-runtime/helpers/toConsumableArray")),o=O(e("babel-runtime/helpers/typeof")),i=O(e("babel-runtime/regenerator")),a=O(e("babel-runtime/helpers/asyncToGenerator")),u=O(e("babel-runtime/helpers/classCallCheck")),s=O(e("babel-runtime/helpers/createClass")),c=r.create=function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n=t.database,o=t.name,a=t.schema,u=t.pouchSettings,s=void 0===u?{}:u,c=t.migrationStrategies,f=void 0===c?{}:c,l=t.autoMigrate,d=void 0===l||l,p=t.statics,b=void 0===p?{}:p,v=t.methods,_=void 0===v?{}:v,m=t.attachments,g=void 0===m?{}:m,w=t.options,x=void 0===w?{}:w;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return h.validateCouchDBString(o),A(a,f),D(b),D(_),D(g),Object.keys(_).filter(function(e){return a.topLevelFields.includes(e)}).forEach(function(e){throw y.default.newRxError("COL18",{funName:e})}),r=new C(n,o,a,s,f,_,g,x),e.next=9,r.prepare();case 9:if(Object.entries(b).forEach(function(e){var t=e.pop(),n=e.pop();r.__defineGetter__(n,function(){return t.bind(r)})}),!d){e.next=13;break}return e.next=13,r.migratePromise();case 13:return(0,j.runPluginHooks)("createRxCollection",r),e.abrupt("return",r);case 15:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}();r.properties=R,r.isInstanceOf=M;var f=O(e("clone")),l=O(e("custom-idle-queue")),d=e("rxjs/operators/filter"),h=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),p=O(e("./rx-document")),b=O(e("./rx-query")),v=O(e("./rx-change-event")),y=O(e("./rx-error")),_=O(e("./data-migrator")),m=O(e("./crypter")),g=O(e("./doc-cache")),w=O(e("./query-cache")),x=O(e("./change-event-buffer")),k=O(e("./overwritable")),j=e("./hooks");function O(e){return e&&e.__esModule?e:{default:e}}var S=["pre","post"],E=["insert","save","remove","create"],C=r.RxCollection=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=this,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};(0,u.default)(this,e),this._isInMemory=!1,this.destroyed=!1,this.database=t,this.name=r,this.schema=n,this._migrationStrategies=i,this._pouchSettings=o,this._methods=a,this._attachments=c,this.options=f,this._atomicUpsertQueues={},this._docCache=g.default.create(),this._queryCache=w.default.create(),this.synced=!1,this.hooks={},this._subs=[],this._repStates=[],this.pouch=null,E.forEach(function(e){S.map(function(t){var r=t+h.ucfirst(e);s[r]=function(r,n){return s.addHook(t,e,r,n)}})})}return(0,s.default)(e,[{key:"prepare",value:function(){var e=(0,a.default)(i.default.mark(function e(){var t=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._dataMigrator=_.default.create(this,this._migrationStrategies),this._crypter=m.default.create(this.database.password,this.schema),this.pouch=this.database._spawnPouchDB(this.name,this.schema.version,this._pouchSettings),e.next=5,this.database.lockedRun(function(){return t.pouch.info()});case 5:return this._observable$=this.database.$.pipe((0,d.filter)(function(e){return e.data.col===t.name})),this._changeEventBuffer=x.default.create(this),e.next=9,Promise.all(this.schema.indexes.map(function(e){var r=e.map(function(e){return t.schema.doKeyCompression()?t._keyCompressor._transformKey("","",e.split(".")):e});return t.database.lockedRun(function(){return t.pouch.createIndex({index:{fields:r}})})}));case 9:this._subs.push(this._observable$.pipe((0,d.filter)(function(e){return!e.data.isLocal})).subscribe(function(e){var r=t._docCache.get(e.data.doc);r&&r._handleChangeEvent(e)}));case 10:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"migrationNeeded",value:function(){return 0!==this.schema.version&&this._dataMigrator._getOldCollections().then(function(e){return e.length>0})}},{key:"migrate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._dataMigrator.migrate(e)}},{key:"migratePromise",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._dataMigrator.migratePromise(e)}},{key:"_handleToPouch",value:function(e){var t=(0,f.default)(e);return t=this._crypter.encrypt(t),t=this.schema.swapPrimaryToId(t),this.schema.doKeyCompression()&&(t=this._keyCompressor.compress(t)),t}},{key:"_handleFromPouch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(0,f.default)(e);return r=this.schema.swapIdToPrimary(r),this.schema.doKeyCompression()&&(r=this._keyCompressor.decompress(r)),t?r:r=this._crypter.decrypt(r)}},{key:"_pouchPut",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n,o=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._handleToPouch(t),r=null,e.prev=2,e.next=5,this.database.lockedRun(function(){return o.pouch.put(t)});case 5:r=e.sent,e.next=21;break;case 8:if(e.prev=8,e.t0=e.catch(2),!a||409!==e.t0.status){e.next=20;break}return e.next=13,this.database.lockedRun(function(){return o.pouch.get(t._id)});case 13:return n=e.sent,t._rev=n._rev,e.next=17,this.database.lockedRun(function(){return o.pouch.put(t)});case 17:r=e.sent,e.next=21;break;case 20:throw e.t0;case 21:return e.abrupt("return",r);case 22:case"end":return e.stop()}},e,this,[[2,8]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_pouchGet",value:function(e){var t=this;return this.pouch.get(e).then(function(e){return t._handleFromPouch(e)})}},{key:"_pouchFind",value:function(){var e=(0,a.default)(i.default.mark(function e(t,r){var n,o,a,u=this,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.keyCompress(),r&&(n.limit=r),e.next=4,this.database.lockedRun(function(){return u.pouch.find(n)});case 4:return o=e.sent,a=o.docs.map(function(e){return u._handleFromPouch(e,s)}),e.abrupt("return",a);case 7:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"_assignMethodsToDocument",value:function(e){Object.entries(this._methods).forEach(function(t){var r=t[0],n=t[1];e.__defineGetter__(r,function(){return n.bind(e)})})}},{key:"_createDocument",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n,o;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t[this.schema.primaryPath],!(n=this._docCache.get(r))){e.next=4;break}return e.abrupt("return",n);case 4:return o=p.default.create(this,t),this._assignMethodsToDocument(o),this._docCache.set(r,o),this._runHooksSync("post","create",o),e.next=10,(0,j.runAsyncPluginHooks)("postCreateRxDocument",o);case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_createDocuments",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t.map(function(e){return r._createDocument(e)})));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"$emit",value:function(e){return this.database.$emit(e)}},{key:"insert",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n,o,a;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!p.default.isInstanceOf(t)){e.next=6;break}if(r=t,t._isTemporary){e.next=5;break}throw y.default.newRxError("COL1",{data:t});case 5:t=t.toJSON();case 6:if(t=(0,f.default)(t),!(t=this.schema.fillObjectWithDefaults(t))._id){e.next=10;break}throw y.default.newRxError("COL2",{data:t});case 10:return"_id"!==this.schema.primaryPath||t._id||(t._id=h.generateId()),e.next=13,this._runHooks("pre","insert",t);case 13:return this.schema.validate(t),e.next=16,this._pouchPut(t);case 16:if(n=e.sent,t[this.schema.primaryPath]=n.id,t._rev=n.rev,o=r,!r){e.next=24;break}r._data=t,e.next=27;break;case 24:return e.next=26,this._createDocument(t);case 26:o=e.sent;case 27:return e.next=29,this._runHooks("post","insert",o);case 29:return a=v.default.create("INSERT",this.database,this,o,t),this.$emit(a),e.abrupt("return",o);case 32:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"upsert",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n,o;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,f.default)(t),r=t[this.schema.primaryPath]){e.next=4;break}throw y.default.newRxError("COL3",{primaryPath:this.schema.primaryPath,data:t});case 4:return e.next=6,this.findOne(r).exec();case 6:if(!(n=e.sent)){e.next=15;break}return t._rev=n._rev,n._data=t,e.next=12,n.save();case 12:return e.abrupt("return",n);case 15:return e.next=17,this.insert(t);case 17:return o=e.sent,e.abrupt("return",o);case 19:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_atomicUpsertEnsureRxDocumentExists",value:function(){var e=(0,a.default)(i.default.mark(function e(t,r){var n,o;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.findOne(t).exec();case 2:if(n=e.sent){e.next=10;break}return e.next=6,this.insert(r);case 6:return o=e.sent,e.abrupt("return",{doc:o,inserted:!0});case 10:return e.abrupt("return",{doc:n,inserted:!1});case 11:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"_atomicUpsertUpdate",value:function(){var e=(0,a.default)(i.default.mark(function e(t,r){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.atomicUpdate(function(e){r._rev=e._rev,e._data=r});case 2:return e.abrupt("return",t);case 3:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"atomicUpsert",value:function(){var e=(0,a.default)(i.default.mark(function e(t){var r,n,o,u=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,f.default)(t),r=t[this.schema.primaryPath]){e.next=4;break}throw y.default.newRxError("COL4",{data:t});case 4:return this._atomicUpsertQueues[r]||(this._atomicUpsertQueues[r]=new l.default),n=this._atomicUpsertQueues[r],e.next=8,n.requestIdlePromise();case 8:return e.next=10,n.wrapCall((0,a.default)(i.default.mark(function e(){var n;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u._atomicUpsertEnsureRxDocumentExists(r,t);case 2:if((n=e.sent).inserted){e.next=11;break}return e.next=6,u._atomicUpsertUpdate(n.doc,t);case 6:return e.next=8,h.nextTick();case 8:case 11:return e.abrupt("return",n.doc);case 12:case"end":return e.stop()}},e,u)})));case 10:return o=e.sent,e.abrupt("return",o);case 12:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"find",value:function(e){if("string"==typeof e)throw y.default.newRxError("COL5",{queryObj:e});return b.default.create("find",e,this)}},{key:"findOne",value:function(e){var t=void 0;if(t="string"==typeof e?b.default.create("findOne",{_id:e},this):b.default.create("findOne",e,this),"number"==typeof e||Array.isArray(e))throw y.default.newRxTypeError("COL6",{queryObj:e});return t}},{key:"dump",value:function(){throw y.default.pluginMissing("json-dump")}},{key:"importDump",value:function(){var e=(0,a.default)(i.default.mark(function e(){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw y.default.pluginMissing("json-dump");case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"watchForChanges",value:function(){throw y.default.pluginMissing("replication")}},{key:"sync",value:function(){throw y.default.pluginMissing("replication")}},{key:"inMemory",value:function(){throw y.default.pluginMissing("in-memory")}},{key:"addHook",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof r)throw y.default.newRxTypeError("COL7",{key:t,when:e});if(!S.includes(e))throw y.default.newRxTypeError("COL8",{key:t,when:e});if(!E.includes(t))throw y.default.newRxError("COL9",{key:t});if("post"===e&&"create"===t&&!0===n)throw y.default.newRxError("COL10",{when:e,key:t,parallel:n});var o=n?"parallel":"series";this.hooks[t]=this.hooks[t]||{},this.hooks[t][e]=this.hooks[t][e]||{series:[],parallel:[]},this.hooks[t][e][o].push(r)}},{key:"getHooks",value:function(e,t){try{return this.hooks[t][e]}catch(e){return{series:[],parallel:[]}}}},{key:"_runHooks",value:function(){var e=(0,a.default)(i.default.mark(function e(t,r,n){var o,a;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.getHooks(t,r)){e.next=3;break}return e.abrupt("return");case 3:a=0;case 4:if(!(a0&&void 0!==arguments[0]?arguments[0]:{};e=this.schema.fillObjectWithDefaults(e);var t=p.default.create(this,e);return t._isTemporary=!0,this._assignMethodsToDocument(t),this._runHooksSync("post","create",t),t}},{key:"destroy",value:function(){var e=(0,a.default)(i.default.mark(function e(){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.destroyed){e.next=2;break}return e.abrupt("return");case 2:this._onDestroyCall&&this._onDestroyCall(),this._subs.forEach(function(e){return e.unsubscribe()}),this._changeEventBuffer&&this._changeEventBuffer.destroy(),this._queryCache.destroy(),this._repStates.forEach(function(e){return e.cancel()}),delete this.database.collections[this.name],this.destroyed=!0;case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){return this.database.removeCollection(this.name)}},{key:"_keyCompressor",get:function(){return this.__keyCompressor||(this.__keyCompressor=k.default.createKeyCompressor(this.schema)),this.__keyCompressor}},{key:"$",get:function(){return this._observable$}},{key:"onDestroy",get:function(){var e=this;return this._onDestroy||(this._onDestroy=new Promise(function(t){return e._onDestroyCall=t})),this._onDestroy}}]),e}(),A=function(e,t){if("object"!==(void 0===t?"undefined":(0,o.default)(t))||Array.isArray(t))throw y.default.newRxTypeError("COL11",{schema:e});if(e.previousVersions.length!==Object.keys(t).length)throw y.default.newRxError("COL12",{have:Object.keys(t),should:e.previousVersions});return e.previousVersions.map(function(e){return{v:e,s:t[e+1+""]}}).filter(function(e){return"function"!=typeof e.s}).forEach(function(t){throw y.default.newRxTypeError("COL13",{version:t.v,type:void 0===t?"undefined":(0,o.default)(t),schema:e})}),!0},P=null;function R(){if(!P){var e=new C,t=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));P=[].concat((0,n.default)(t),(0,n.default)(r))}return P}var D=function(e){Object.entries(e).forEach(function(e){if("string"!=typeof e[0])throw y.default.newRxTypeError("COL14",{name:e[0]});if(e[0].startsWith("_"))throw y.default.newRxTypeError("COL15",{name:e[0]});if("function"!=typeof e[1])throw y.default.newRxTypeError("COL16",{name:e[0],type:(0,o.default)(e[1])});if(R().includes(e[0])||p.default.properties().includes(e[0]))throw y.default.newRxError("COL17",{name:e[0]})})};function M(e){return e instanceof C}r.default={create:c,properties:R,isInstanceOf:M,RxCollection:C}},{"./change-event-buffer":2,"./crypter":4,"./data-migrator":5,"./doc-cache":6,"./hooks":7,"./overwritable":11,"./query-cache":27,"./rx-change-event":30,"./rx-document":33,"./rx-error":34,"./rx-query":35,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,clone:60,"custom-idle-queue":487,"rxjs/operators/filter":569}],32:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RxSchema=r.checkAdapter=r.removeDatabase=r.create=r.RxDatabase=void 0;var n=j(e("babel-runtime/helpers/toConsumableArray")),o=j(e("babel-runtime/regenerator")),i=j(e("babel-runtime/helpers/asyncToGenerator")),a=j(e("babel-runtime/helpers/classCallCheck")),u=j(e("babel-runtime/helpers/createClass")),s=r.create=function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n=t.name,i=t.adapter,a=t.password,u=t.multiInstance,s=void 0===u||u,c=t.ignoreDuplicate,f=void 0!==c&&c,l=t.options,d=void 0===l?{}:l;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(p.validateCouchDBString(n),"string"!=typeof i){e.next=6;break}if(h.default.adapters&&h.default.adapters[i]){e.next=4;break}throw b.default.newRxError("DB9",{adapter:i});case 4:e.next=9;break;case 6:if(p.isLevelDown(i),h.default.adapters&&h.default.adapters.leveldb){e.next=9;break}throw b.default.newRxError("DB10",{adapter:i});case 9:return a&&g.default.validatePassword(a),f||P(n,i),O[n]||(O[n]=[]),O[n].push(i),r=new E(n,i,a,s,d),e.next=16,r.prepare();case 16:return(0,w.runPluginHooks)("createRxDatabase",r),e.abrupt("return",r);case 18:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),c=r.removeDatabase=function(){var e=(0,i.default)(o.default.mark(function e(t,r){var n,i,a,u;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=M(t,r),i=D(t,r,"_socket",0),a=I(t,r),e.next=5,a.allDocs({include_docs:!0});case 5:return u=e.sent,Promise.all(u.rows.map(function(e){return e.id}).map(function(e){var n=e.split("-"),o=n[0],i=parseInt(n[1],10);return D(t,r,o,i).destroy()})),e.next=9,Promise.all([a.destroy(),n.destroy(),i.destroy()]);case 9:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),f=r.checkAdapter=function(){var e=(0,i.default)(o.default.mark(function e(t){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.default.checkAdapter(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}();r.properties=A,r.isInstanceOf=T,r.dbCount=L;var l=j(e("random-token")),d=j(e("custom-idle-queue")),h=j(e("./pouch-db")),p=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),b=j(e("./rx-error")),v=j(e("./rx-collection")),y=j(e("./rx-schema")),_=j(e("./rx-change-event")),m=j(e("./socket")),g=j(e("./overwritable")),w=e("./hooks"),x=e("rxjs/Subject"),k=e("rxjs/operators/filter");function j(e){return e&&e.__esModule?e:{default:e}}var O={},S=0,E=r.RxDatabase=function(){function e(t,r,n,o,i){(0,a.default)(this,e),void 0!==t&&S++,this.name=t,this.adapter=r,this.password=n,this.multiInstance=o,this.options=i,this.idleQueue=new d.default,this.token=(0,l.default)(10),this._subs=[],this.destroyed=!1,this.collections={},this.subject=new x.Subject,this.observable$=this.subject.asObservable().pipe((0,k.filter)(function(e){return _.default.isInstanceOf(e)}))}return(0,u.default)(e,[{key:"prepare",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t,r=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.password){e.next=22;break}return e.next=3,this.lockedRun(function(){return r._adminPouch.info()});case 3:return t=null,e.prev=4,e.next=7,this.lockedRun(function(){return r._adminPouch.get("_local/pwHash")});case 7:t=e.sent,e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:if(t){e.next=20;break}return e.prev=13,e.next=16,this.lockedRun(function(){return r._adminPouch.put({_id:"_local/pwHash",value:p.hash(r.password)})});case 16:e.next=20;break;case 18:e.prev=18,e.t1=e.catch(13);case 20:if(!t||!this.password||p.hash(this.password)===t.value){e.next=22;break}throw b.default.newRxError("DB1",{passwordHash:p.hash(this.password),existingPasswordHash:t.value});case 22:if(!this.multiInstance){e.next=27;break}return e.next=25,m.default.create(this);case 25:this.socket=e.sent,this._subs.push(this.socket.messages$.subscribe(function(e){return r.$emit(e)}));case 27:case"end":return e.stop()}},e,this,[[4,10],[13,18]])}));return function(){return e.apply(this,arguments)}}()},{key:"_spawnPouchDB",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return D(this.name,this.adapter,e,t,r)}},{key:"waitForLeadership",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.multiInstance){e.next=2;break}return e.abrupt("return",!0);case 2:return e.abrupt("return",this.leaderElector.waitForLeadership());case 3:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"writeToSocket",value:function(e){return this.multiInstance&&!e.isIntern()&&this.socket?this.socket.write(e).then(function(){return!0}):Promise.resolve(!1)}},{key:"$emit",value:function(e){e&&(this.subject.next(e),e.data.it===this.token&&this.writeToSocket(e))}},{key:"_collectionNamePrimary",value:function(e,t){return e+"-"+t.version}},{key:"removeCollectionDoc",value:function(e,t){var r=this,n=this._collectionNamePrimary(e,t);return this._collectionsPouch.get(n).then(function(e){return r.lockedRun(function(){return r._collectionsPouch.remove(e)})})}},{key:"_removeAllOfCollection",value:function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n,i=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.lockedRun(function(){return i._collectionsPouch.allDocs({include_docs:!0})});case 2:return r=e.sent,n=r.rows.map(function(e){return e.doc}).filter(function(e){return e._id.split("-")[0]===t}),e.next=6,Promise.all(n.map(function(e){return i.lockedRun(function(){return i._collectionsPouch.remove(e)})}));case 6:return e.abrupt("return",n.map(function(e){return e.version}));case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"collection",value:function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n,i,a,u,s,c=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=2;break}return e.abrupt("return",this.collections[t]);case 2:if(t.database=this,"_"!==t.name.charAt(0)){e.next=5;break}throw b.default.newRxError("DB2",{name:t.name});case 5:if(!this.collections[t.name]){e.next=7;break}throw b.default.newRxError("DB3",{name:t.name});case 7:if(t.schema){e.next=9;break}throw b.default.newRxError("DB4",{name:t.name,args:t});case 9:if(y.default.isInstanceOf(t.schema)||(t.schema=y.default.create(t.schema)),r=this._collectionNamePrimary(t.name,t.schema),!A().includes(t.name)){e.next=13;break}throw b.default.newRxError("DB5",{name:t.name});case 13:return n=t.schema.hash,i=null,e.prev=15,e.next=18,this.lockedRun(function(){return c._collectionsPouch.get(r)});case 18:i=e.sent,e.next=23;break;case 21:e.prev=21,e.t0=e.catch(15);case 23:if(!i||i.schemaHash===n){e.next=30;break}return a=this._spawnPouchDB(t.name,t.schema.version,t.pouchSettings),e.next=27,a.find({selector:{language:{$ne:"query"}},limit:1});case 27:if(0===e.sent.docs.length){e.next=30;break}throw b.default.newRxError("DB6",{name:t.name,previousSchemaHash:i.schemaHash,schemaHash:n});case 30:return e.next=32,v.default.create(t);case 32:if(u=e.sent,!(Object.keys(u.schema.encryptedPaths).length>0)||this.password){e.next=35;break}throw b.default.newRxError("DB7",{name:t.name});case 35:if(i){e.next=43;break}return e.prev=36,e.next=39,this.lockedRun(function(){return c._collectionsPouch.put({_id:r,schemaHash:n,schema:u.schema.normalized,version:u.schema.version})});case 39:e.next=43;break;case 41:e.prev=41,e.t1=e.catch(36);case 43:return(s=_.default.create("RxDatabase.collection",this)).data.v=u.name,s.data.col="_collections",this.$emit(s),this.collections[t.name]=u,this.__defineGetter__(t.name,function(){return c.collections[t.name]}),e.abrupt("return",u);case 50:case"end":return e.stop()}},e,this,[[15,21],[36,41]])}));return function(t){return e.apply(this,arguments)}}()},{key:"removeCollection",value:function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n,i=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.collections[t]){e.next=3;break}return e.next=3,this.collections[t].destroy();case 3:return e.next=5,this._removeAllOfCollection(t);case 5:return r=e.sent,n=r.map(function(e){return i._spawnPouchDB(t,e)}),e.abrupt("return",Promise.all(n.map(function(e){return i.lockedRun(function(){return e.destroy()})})));case 8:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"lockedRun",value:function(e){return this.idleQueue.wrapCall(e)}},{key:"requestIdlePromise",value:function(){return this.idleQueue.requestIdlePromise()}},{key:"dump",value:function(){throw b.default.pluginMissing("json-dump")}},{key:"importDump",value:function(){throw b.default.pluginMissing("json-dump")}},{key:"destroy",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(S--,this.destroyed=!0,e.t0=this.socket,!e.t0){e.next=8;break}return e.next=8,this.socket.destroy();case 8:if(!this._leaderElector){e.next=11;break}return e.next=11,this._leaderElector.destroy();case 11:return this._subs.map(function(e){return e.unsubscribe()}),e.next=14,Promise.all(Object.keys(this.collections).map(function(e){return t.collections[e]}).map(function(e){return e.destroy()}));case 14:R(this.name,this.adapter);case 15:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e=this;return this.destroy().then(function(){return c(e.name,e.adapter)})}},{key:"_adminPouch",get:function(){return this.__adminPouch||(this.__adminPouch=M(this.name,this.adapter)),this.__adminPouch}},{key:"_collectionsPouch",get:function(){return this.__collectionsPouch||(this.__collectionsPouch=I(this.name,this.adapter)),this.__collectionsPouch}},{key:"leaderElector",get:function(){return this._leaderElector||(this._leaderElector=g.default.createLeaderElector(this)),this._leaderElector}},{key:"isLeader",get:function(){return!this.multiInstance||this.leaderElector.isLeader}},{key:"$",get:function(){return this.observable$}}]),e}(),C=null;function A(){if(!C){var e=new E,t=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));C=[].concat((0,n.default)(t),(0,n.default)(r))}return C}function P(e,t){if(!O[e])return!1;var r=!1;if(O[e].forEach(function(e){e===t&&(r=!0)}),r)throw b.default.newRxError("DB8",{name:e,adapter:t,link:"https://pubkey.github.io/rxdb/rx-database.html#ignoreduplicate"})}function R(e,t){if(O[e]){var r=O[e].indexOf(t);O[e].splice(r,1)}}function D(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={location:e+"-rxdb-"+n+"-"+r,adapter:p.adapterObject(t),settings:o};return(0,w.runPluginHooks)("preCreatePouchDb",i),new h.default(i.location,i.adapter,i.settings)}function M(e,t){return D(e,t,"_admin",0,{auto_compaction:!1,revs_limit:1})}function I(e,t){return D(e,t,"_collections",0,{auto_compaction:!1,revs_limit:1})}function T(e){return e instanceof E}function L(){return S}r.RxSchema=y.default,r.default={create:s,removeDatabase:c,checkAdapter:f,isInstanceOf:T,RxDatabase:E,RxSchema:y.default,dbCount:L}},{"./hooks":7,"./overwritable":11,"./pouch-db":26,"./rx-change-event":30,"./rx-collection":31,"./rx-error":34,"./rx-schema":36,"./socket":37,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/regenerator":57,"custom-idle-queue":487,"random-token":547,"rxjs/Subject":557,"rxjs/operators/filter":569}],33:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RxDocument=void 0;var n=m(e("babel-runtime/helpers/toConsumableArray")),o=m(e("babel-runtime/regenerator")),i=m(e("babel-runtime/helpers/asyncToGenerator")),a=m(e("babel-runtime/helpers/typeof")),u=m(e("babel-runtime/helpers/classCallCheck")),s=m(e("babel-runtime/helpers/createClass"));r.create=w,r.createAr=x,r.properties=j,r.isInstanceOf=O;var c=m(e("clone")),f=m(e("object-path")),l=m(e("deep-equal")),d=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),h=m(e("./rx-change-event")),p=m(e("./rx-error")),b=e("./hooks"),v=e("rxjs/BehaviorSubject"),y=e("rxjs/operators/distinctUntilChanged"),_=e("rxjs/operators/map");function m(e){return e&&e.__esModule?e:{default:e}}var g=r.RxDocument=function(){function e(t,r){(0,u.default)(this,e),this.collection=t,this._isTemporary=!1,this._dataSync$=new v.BehaviorSubject((0,c.default)(r)),this._data=(0,c.default)(r),this._atomicUpdates=[],this._atomicUpdatesResolveFunctions=new WeakMap,this._synced$=new v.BehaviorSubject(!0),this._deleted$=new v.BehaviorSubject(!1)}return(0,s.default)(e,[{key:"prepare",value:function(){this._defineGetterSetter(this,"")}},{key:"resync",value:function(){var e=this._dataSync$.getValue();this._synced$.getValue()&&(0,l.default)(e,this._data)||(this._data=(0,c.default)(this._dataSync$.getValue()),this._synced$.next(!0))}},{key:"_handleChangeEvent",value:function(e){if(e.data.doc===this.primary)switch(e.data.op){case"INSERT":break;case"UPDATE":var t=(0,c.default)(e.data.v),r=this._dataSync$.getValue(),n=this._data;(0,l.default)(r,n)?(this._data=t,!0!==this._synced$.getValue()&&this._synced$.next(!0)):(!1!==this._synced$.getValue()&&this._synced$.next(!1),this._data._rev=t._rev),this._dataSync$.next((0,c.default)(t));break;case"REMOVE":this.collection._docCache.delete(this.primary),this._deleted$.next(!0)}}},{key:"$emit",value:function(e){return this.collection.$emit(e)}},{key:"get$",value:function(e){if(e.includes(".item."))throw p.default.newRxError("DOC1",{path:e});if(e===this.primaryPath)throw p.default.newRxError("DOC2");if(this.collection.schema.finalFields.includes(e))throw p.default.newRxError("DOC3",{path:e});if(!this.collection.schema.getSchemaByObjectPath(e))throw p.default.newRxError("DOC4",{path:e});return this._dataSync$.pipe((0,_.map)(function(t){return f.default.get(t,e)}),(0,y.distinctUntilChanged)()).asObservable()}},{key:"populate",value:function(e){var t=this.collection.schema.getSchemaByObjectPath(e),r=this.get(e);if(!t)throw p.default.newRxError("DOC5",{path:e});if(!t.ref)throw p.default.newRxError("DOC6",{path:e,schemaObj:t});var n=this.collection.database.collections[t.ref];if(!n)throw p.default.newRxError("DOC7",{ref:t.ref,path:e,schemaObj:t});return"array"===t.type?Promise.all(r.map(function(e){return n.findOne(e).exec()})):n.findOne(r).exec()}},{key:"get",value:function(e){if(this._data){var t=f.default.get(this._data,e);return"object"!==(void 0===(t=(0,c.default)(t))?"undefined":(0,a.default)(t))||Array.isArray(t)?t:(this._defineGetterSetter(t,e),t)}}},{key:"_defineGetterSetter",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(null!==e){var n=this.collection.schema.getSchemaByObjectPath(r);n.properties&&(n=n.properties),Object.keys(n).forEach(function(n){var o=d.trimDots(r+"."+n);e.__defineGetter__(n,function(){return t.get(o)}),Object.defineProperty(e,n+"$",{get:function(){return t.get$(o)},enumerable:!1,configurable:!1}),Object.defineProperty(e,n+"_",{get:function(){return t.populate(o)},enumerable:!1,configurable:!1}),e.__defineSetter__(n,function(e){return t.set(o,e)})})}}},{key:"toJSON",value:function(){return(0,c.default)(this._data)}},{key:"set",value:function(e,t){if("string"!=typeof e)throw p.default.newRxTypeError("DOC15",{objPath:e,value:t});if(!this._isTemporary&&e===this.primaryPath)throw p.default.newRxError("DOC8",{objPath:e,value:t,primaryPath:this.primaryPath});if(!this._isTemporary&&this.collection.schema.finalFields.includes(e))throw p.default.newRxError("DOC9",{path:e,value:t});if(!Object.is(this.get(e),t)){var r=e.split(".");r.pop();var n=r.join(".");if(void 0===f.default.get(this._data,n))throw p.default.newRxError("DOC10",{childpath:e,rootPath:n});return this._isTemporary||this.collection.schema.validate(t,e),f.default.set(this._data,e,t),this}}},{key:"update",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw p.default.pluginMissing("update");case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"putAttachment",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw p.default.pluginMissing("attachments");case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getAttachment",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw p.default.pluginMissing("attachments");case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"allAttachments",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw p.default.pluginMissing("attachments");case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"atomicUpdate",value:function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._atomicUpdates.push(t),r=new Promise(function(e,r){n._atomicUpdatesResolveFunctions.set(t,{resolve:e,reject:r})}),this._runAtomicUpdates(),e.abrupt("return",r);case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_runAtomicUpdates",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.__runAtomicUpdates_running){e.next=4;break}return e.abrupt("return");case 4:this.__runAtomicUpdates_running=!0;case 5:if(0!==this._atomicUpdates.length){e.next=8;break}return this.__runAtomicUpdates_running=!1,e.abrupt("return");case 8:return t=this._atomicUpdates.shift(),e.prev=10,e.next=13,t(this);case 13:return e.next=15,this.save();case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(10),this._atomicUpdatesResolveFunctions.get(t).reject(e.t0);case 20:this._atomicUpdatesResolveFunctions.get(t).resolve(this),this.__runAtomicUpdates_running=!1,this._runAtomicUpdates();case 23:case"end":return e.stop()}},e,this,[[10,17]])}));return function(){return e.apply(this,arguments)}}()},{key:"save",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t,r,n;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isTemporary){e.next=2;break}return e.abrupt("return",this._saveTemporary());case 2:if(!this._deleted$.getValue()){e.next=4;break}throw p.default.newRxError("DOC11",{id:this.primary,document:this});case 4:if(!(0,l.default)(this._data,this._dataSync$.getValue())){e.next=7;break}return this._synced$.next(!0),e.abrupt("return",!1);case 7:return e.next=9,this.collection._runHooks("pre","save",this);case 9:return this.collection.schema.validate(this._data),e.next=12,this.collection._pouchPut((0,c.default)(this._data));case 12:if((t=e.sent).ok){e.next=15;break}throw p.default.newRxError("DOC12",{data:t});case 15:return(r=(0,c.default)(this._data))._rev=t.rev,this._data=r,e.next=20,this.collection._runHooks("post","save",this);case 20:return this._synced$.next(!0),this._dataSync$.next((0,c.default)(r)),n=h.default.create("UPDATE",this.collection.database,this.collection,this,r),this.$emit(n),e.abrupt("return",!0);case 25:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_saveTemporary",value:function(){var e=(0,i.default)(o.default.mark(function e(){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.collection.insert(this);case 2:return this._isTemporary=!1,this.collection._docCache.set(this.primary,this),this._synced$.next(!0),this._dataSync$.next((0,c.default)(this._data)),e.abrupt("return",!0);case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.deleted){e.next=2;break}throw p.default.newRxError("DOC13",{document:this,id:this.primary});case 2:return e.next=4,d.promiseWait(0);case 4:return e.next=6,this.collection._runHooks("pre","remove",this);case 6:return e.next=8,this.collection.database.lockedRun(function(){return t.collection.pouch.remove(t.primary,t._data._rev)});case 8:return this.$emit(h.default.create("REMOVE",this.collection.database,this.collection,this,this._data)),e.next=11,this.collection._runHooks("post","remove",this);case 11:return e.next=13,d.promiseWait(0);case 13:return e.abrupt("return");case 14:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){throw p.default.newRxError("DOC14")}},{key:"primaryPath",get:function(){return this.collection.schema.primaryPath}},{key:"primary",get:function(){return this._data[this.primaryPath]}},{key:"revision",get:function(){return this._data._rev}},{key:"deleted$",get:function(){return this._deleted$.asObservable()}},{key:"deleted",get:function(){return this._deleted$.getValue()}},{key:"synced$",get:function(){return this._synced$.pipe((0,y.distinctUntilChanged)()).asObservable()}},{key:"synced",get:function(){return this._synced$.getValue()}},{key:"$",get:function(){return this._dataSync$.asObservable()}},{key:"allAttachments$",get:function(){throw p.default.pluginMissing("attachments")}}]),e}();function w(e,t){if(t[e.schema.primaryPath]&&t[e.schema.primaryPath].startsWith("_design"))return null;var r=new g(e,t);return r.prepare(),(0,b.runPluginHooks)("createRxDocument",r),r}function x(e,t){return t.map(function(t){return w(e,t)}).filter(function(e){return null!==e})}var k=void 0;function j(){if(!k){var e=new g,t=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));k=[].concat((0,n.default)(t),(0,n.default)(r),["deleted","synced"])}return k}function O(e){return e instanceof g}r.default={create:w,createAr:x,properties:j,RxDocument:g,isInstanceOf:O}},{"./hooks":7,"./rx-change-event":30,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/toConsumableArray":55,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,clone:60,"deep-equal":488,"object-path":503,"rxjs/BehaviorSubject":550,"rxjs/operators/distinctUntilChanged":568,"rxjs/operators/map":571}],34:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.newRxTypeError=r.newRxError=r.RxTypeError=r.RxError=void 0;var n=c(e("babel-runtime/helpers/classCallCheck")),o=c(e("babel-runtime/helpers/createClass")),i=c(e("babel-runtime/helpers/possibleConstructorReturn")),a=c(e("babel-runtime/helpers/inherits"));r.pluginMissing=h;var u=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),s=c(e("./overwritable"));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t){return"RxError:\n"+e+"\n"+function(e){var t="";return 0===Object.keys(e).length?t:(t+="Given parameters: {\n",t+=Object.keys(e).map(function(t){var r="[object Object]";try{r=JSON.stringify(e[t],function(e,t){return void 0===t?null:t},2)}catch(e){}return t+":"+r}).join("\n"),t+="}")}(t)},l=r.RxError=function(e){(0,a.default)(t,e);function t(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n.default)(this,t);var a=f(r,o),u=(0,i.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a));return u.code=e,u.message=a,u.parameters=o,u.rxdb=!0,u}return(0,o.default)(t,[{key:"toString",value:function(){return this.message}},{key:"name",get:function(){return"RxError"}},{key:"typeError",get:function(){return!1}}]),t}(Error),d=r.RxTypeError=function(e){(0,a.default)(t,e);function t(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n.default)(this,t);var a=f(r,o),u=(0,i.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a));return u.code=e,u.message=a,u.parameters=o,u.rxdb=!0,u}return(0,o.default)(t,[{key:"toString",value:function(){return this.message}},{key:"name",get:function(){return"RxError"}},{key:"typeError",get:function(){return!0}}]),t}(TypeError);function h(e){return new l("PU","You are using a function which must be overwritten by a plugin.\n You should either prevent the usage of this function or add the plugin via:\n - es5-require:\n RxDB.plugin(require('rxdb/plugins/"+e+"'))\n - es6-import:\n import "+u.ucfirst(e)+"Plugin from 'rxdb/plugins/"+e+"';\n RxDB.plugin("+u.ucfirst(e)+"Plugin);\n ",{pluginKey:e})}var p=r.newRxError=function(e,t){return new l(e,s.default.tunnelErrorMessage(e),t)},b=r.newRxTypeError=function(e,t){return new d(e,s.default.tunnelErrorMessage(e),t)};r.default={newRxError:p,newRxTypeError:b,pluginMissing:h}},{"./overwritable":11,"./util":38,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/inherits":53,"babel-runtime/helpers/possibleConstructorReturn":54}],35:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RxQuery=void 0;var n=g(e("babel-runtime/helpers/typeof")),o=g(e("babel-runtime/regenerator")),i=g(e("babel-runtime/helpers/asyncToGenerator")),a=g(e("babel-runtime/helpers/defineProperty")),u=g(e("babel-runtime/helpers/classCallCheck")),s=g(e("babel-runtime/helpers/createClass"));r.create=S,r.isInstanceOf=E;var c=g(e("deep-equal")),f=g(e("custom-idle-queue")),l=g(e("./mquery/mquery")),d=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),h=g(e("./query-change-detector")),p=g(e("./rx-error")),b=e("./hooks"),v=e("rxjs/observable/merge"),y=e("rxjs/BehaviorSubject"),_=e("rxjs/operators/mergeMap"),m=e("rxjs/operators/filter");function g(e){return e&&e.__esModule?e:{default:e}}var w=0,x=function(){return++w},k=r.RxQuery=function(){function e(t,r,n){(0,u.default)(this,e),this.op=t,this.collection=n,this.id=x(),r||(r=this._defaultQuery()),this.mquery=new l.default(r),this._queryChangeDetector=h.default.create(this),this._resultsData=null,this._results$=new y.BehaviorSubject(null),this._latestChangeEvent=-1,this._execOverDatabaseCount=0}return(0,s.default)(e,[{key:"_defaultQuery",value:function(){return(0,a.default)({},this.collection.schema.primaryPath,{})}},{key:"_clone",value:function(){var t=new e(this.op,this._defaultQuery(),this.collection);return t.mquery=this.mquery.clone(),t}},{key:"_tunnelQueryCache",value:function(){return this.collection._queryCache.getByQuery(this)}},{key:"toString",value:function(){if(!this.stringRep){var e=d.sortObject({op:this.op,options:this.mquery.options,_conditions:this.mquery._conditions,_path:this.mquery._path,_fields:this.mquery._fields},!0);this.stringRep=JSON.stringify(e,d.stringifyFilter)}return this.stringRep}},{key:"_isResultsInSync",value:function(){return this._latestChangeEvent>=this.collection._changeEventBuffer.counter}},{key:"_ensureEqual",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t,r=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ensureEqualQueue.requestIdlePromise();case 2:return e.next=4,this._ensureEqualQueue.wrapCall(function(){return r.__ensureEqual()});case 4:return t=e.sent,e.abrupt("return",t);case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"__ensureEqual",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t,r,n,i,a,u,s;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!1,!this._isResultsInSync()){e.next=3;break}return e.abrupt("return",!1);case 3:if(r=!1,-1===this._latestChangeEvent&&(r=!0),r){e.next=19;break}if(null!==(n=this.collection._changeEventBuffer.getFrom(this._latestChangeEvent+1))){e.next=11;break}r=!0,e.next=19;break;case 11:if(this._latestChangeEvent=this.collection._changeEventBuffer.counter,i=this.collection._changeEventBuffer.reduceByLastOfDoc(n),a=this._queryChangeDetector.runChangeDetection(i),!Array.isArray(a)&&a&&(r=!0),!Array.isArray(a)||(0,c.default)(a,this._resultsData)){e.next=19;break}return t=!0,e.next=19,this._setResultData(a);case 19:if(!r){e.next=29;break}return u=this.collection._changeEventBuffer.counter,e.next=23,this._execOverDatabase();case 23:if(s=e.sent,this._latestChangeEvent=u,(0,c.default)(s,this._resultsData)){e.next=29;break}return t=!0,e.next=29,this._setResultData(s);case 29:return e.abrupt("return",t);case 30:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_setResultData",value:function(){var e=(0,i.default)(o.default.mark(function e(t){var r,n;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._resultsData=t,e.next=3,this.collection._createDocuments(this._resultsData);case 3:r=e.sent,n=r,"findOne"===this.op&&(n=0===r.length?null:r[0]),this._results$.next(n);case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_execOverDatabase",value:function(){this._execOverDatabaseCount=this._execOverDatabaseCount+1;var e=void 0;switch(this.op){case"find":e=this.collection._pouchFind(this);break;case"findOne":e=this.collection._pouchFind(this,1);break;default:throw p.default.newRxError("QU1",{op:this.op})}return e}},{key:"toJSON",value:function(){if(this._toJSON)return this._toJSON;var e=this.collection.schema.primaryPath,t={selector:this.mquery._conditions},r=this.mquery._optionsForExec();if(r.sort){var o=[];Object.keys(r.sort).map(function(t){var n="asc";-1===r.sort[t]&&(n="desc");var i={};t===e&&(t="_id"),i[t]=n,o.push(i)}),t.sort=o}else t.sort=[{_id:"asc"}];if(r.limit){if("number"!=typeof r.limit)throw p.default.newRxTypeError("QU2",{limit:r.limit});t.limit=r.limit}if(r.skip){if("number"!=typeof r.skip)throw p.default.newRxTypeError("QU3",{skip:r.skip});t.skip=r.skip}return t.selector.language||(t.selector.language={}),t.selector.language.$ne="query",Object.entries(t.selector).filter(function(e){return"object"===(0,n.default)(e[1])}).filter(function(e){return null!==e[1]}).filter(function(e){return!Array.isArray(e[1])}).filter(function(e){return 0===Object.keys(e[1]).length}).forEach(function(e){return delete t.selector[e[0]]}),"_id"!==e&&t.selector[e]&&(t.selector._id=t.selector[e],delete t.selector[e]),this._toJSON=t,this._toJSON}},{key:"keyCompress",value:function(){return this.collection.schema.doKeyCompression()?(this._keyCompress||(this._keyCompress=this.collection._keyCompressor.compressQuery(this.toJSON())),this._keyCompress):this.toJSON()}},{key:"remove",value:function(){var e=void 0;return this.exec().then(function(t){return e=t,Array.isArray(t)?Promise.all(t.map(function(e){return e.remove()})):t.remove()}).then(function(){return e})}},{key:"update",value:function(){throw p.default.pluginMissing("update")}},{key:"exec",value:function(){var e=(0,i.default)(o.default.mark(function e(){var t;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=!0;case 1:if(!t){e.next=7;break}return e.next=4,this._ensureEqual();case 4:t=e.sent,e.next=1;break;case 7:return e.abrupt("return",this._results$.getValue());case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"regex",value:function(e){var t=this._clone();if(this.mquery._path===this.collection.schema.primaryPath)throw p.default.newRxError("QU4",{path:this.mquery._path});return t.mquery.regex(e),t._tunnelQueryCache()}},{key:"sort",value:function(e){var t=function(e){throw p.default.newRxError("QU5",{key:e})},r=this._clone();if("object"!==(void 0===e?"undefined":(0,n.default)(e))){var o="-"===e.charAt(0)?e.substring(1):e;if(!r.mquery._conditions[o]){var i=r.collection.schema.getSchemaByObjectPath(o);i||t(o),"integer"===i.type?r.mquery.where(o).gt(-1e28):r.mquery.where(o).gt(null)}}else Object.keys(e).filter(function(e){return!r.mquery._conditions[e]||!r.mquery._conditions[e].$gt}).forEach(function(e){var n=r.collection.schema.getSchemaByObjectPath(e);n||t(e),"integer"===n.type?r.mquery.where(e).gt(-1e28):r.mquery.where(e).gt(null)});return r.mquery.sort(e),r._tunnelQueryCache()}},{key:"limit",value:function(e){if("findOne"===this.op)throw p.default.newRxError("QU6");var t=this._clone();return t.mquery.limit(e),t._tunnelQueryCache()}},{key:"_ensureEqualQueue",get:function(){return this.__ensureEqualQueue||(this.__ensureEqualQueue=new f.default),this.__ensureEqualQueue}},{key:"$",get:function(){var e=this;if(!this._$){var t=this._results$.pipe((0,_.mergeMap)(function(){var t=(0,i.default)(o.default.mark(function t(r){return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._ensureEqual();case 2:if(!t.sent){t.next=7;break}return t.abrupt("return","WAITFORNEXTEMIT");case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}},t,e)}));return function(e){return t.apply(this,arguments)}}()),(0,m.filter)(function(e){return"WAITFORNEXTEMIT"!==e})).asObservable(),r=this.collection.$.pipe((0,m.filter)(function(e){return["INSERT","UPDATE","REMOVE"].includes(e.data.op)}),(0,m.filter)(function(){return e._ensureEqual(),!1}));this._$=(0,v.merge)(t,r)}return this._$}}]),e}(),j=function(e,t){t.filter(function(e){return!e.startsWith("_")}).filter(function(t){return!e[t]}).forEach(function(t){e[t]=function(e){var r=this._clone();return r.mquery[t](e),r._tunnelQueryCache()}})},O=!1;function S(e,t,r){if(t&&"object"!==(void 0===t?"undefined":(0,n.default)(t)))throw p.default.newRxTypeError("QU7",{queryObj:t});if(Array.isArray(t))throw p.default.newRxTypeError("QU8",{queryObj:t});var o=new k(e,t,r);return o=o._tunnelQueryCache(),O||(O=!0,j(Object.getPrototypeOf(o),Object.getOwnPropertyNames(o.mquery.__proto__))),(0,b.runPluginHooks)("createRxQuery",o),o}function E(e){return e instanceof k}r.default={create:S,RxQuery:k,isInstanceOf:E}},{"./hooks":7,"./mquery/mquery":9,"./query-change-detector":28,"./rx-error":34,"./util":38,"babel-runtime/helpers/asyncToGenerator":49,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/defineProperty":52,"babel-runtime/helpers/typeof":56,"babel-runtime/regenerator":57,"custom-idle-queue":487,"deep-equal":488,"rxjs/BehaviorSubject":550,"rxjs/observable/merge":566,"rxjs/operators/filter":569,"rxjs/operators/mergeMap":573}],36:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RxSchema=void 0;var n=l(e("babel-runtime/helpers/typeof")),o=l(e("babel-runtime/helpers/classCallCheck")),i=l(e("babel-runtime/helpers/createClass"));r.getEncryptedPaths=h,r.hasCrypt=p,r.getIndexes=b,r.getPrimary=v,r.getFinalFields=y,r.normalize=_,r.create=g,r.isInstanceOf=w;var a=l(e("object-path")),u=l(e("clone")),s=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),c=l(e("./rx-error")),f=e("./hooks");function l(e){return e&&e.__esModule?e:{default:e}}var d=r.RxSchema=function(){function e(t){var r=this;(0,o.default)(this,e),this.jsonID=t,this.compoundIndexes=this.jsonID.compoundIndexes,this.indexes=b(this.jsonID),this.indexes.forEach(function(e){e.filter(function(e){return!r.jsonID.required.includes(e)}).filter(function(e){return!e.includes(".")}).forEach(function(e){return r.jsonID.required.push(e)})}),this.primaryPath=v(this.jsonID),this.primaryPath&&this.jsonID.required.push(this.primaryPath),this.finalFields=y(this.jsonID),this.jsonID.required=this.jsonID.required.concat(this.finalFields).filter(function(e,t,r){return r.indexOf(e)===t}),this.jsonID.properties[this.primaryPath]||(this.jsonID.properties[this.primaryPath]={type:"string",minLength:1})}return(0,i.default)(e,[{key:"getSchemaByObjectPath",value:function(e){e="properties."+(e=e.replace(/\./g,".properties.")),e=s.trimDots(e);return a.default.get(this.jsonID,e)}},{key:"validate",value:function(){throw c.default.pluginMissing("validate")}},{key:"fillObjectWithDefaults",value:function(e){return e=(0,u.default)(e),Object.entries(this.defaultValues).filter(function(t){return!e.hasOwnProperty(t[0])}).forEach(function(t){e[t[0]]=t[1]}),e}},{key:"swapIdToPrimary",value:function(e){return"_id"===this.primaryPath||e[this.primaryPath]?e:(e[this.primaryPath]=e._id,delete e._id,e)}},{key:"swapPrimaryToId",value:function(e){var t=this;if("_id"===this.primaryPath)return e;var r={};return Object.entries(e).forEach(function(e){var n=e[0]===t.primaryPath?"_id":e[0];r[n]=e[1]}),r}},{key:"doKeyCompression",value:function(){return!this.jsonID.disableKeyCompression}},{key:"version",get:function(){return this.jsonID.version}},{key:"previousVersions",get:function(){var e=0;return new Array(this.version).fill(0).map(function(){return e++})}},{key:"crypt",get:function(){return this._crypt||(this._crypt=p(this.jsonID)),this._crypt}},{key:"normalized",get:function(){return this._normalized||(this._normalized=_(this.jsonID)),this._normalized}},{key:"topLevelFields",get:function(){return Object.keys(this.normalized.properties)}},{key:"defaultValues",get:function(){var e=this;return this._defaultValues||(this._defaultValues={},Object.entries(this.normalized.properties).filter(function(e){return e[1].default}).forEach(function(t){return e._defaultValues[t[0]]=t[1].default})),this._defaultValues}},{key:"encryptedPaths",get:function(){return this._encryptedPaths||(this._encryptedPaths=h(this.jsonID)),this._encryptedPaths}},{key:"hash",get:function(){return this._hash||(this._hash=s.hash(this.normalized)),this._hash}}]),e}();function h(e){var t={};return function e(r,o){if("object"===(void 0===r?"undefined":(0,n.default)(r)))if(r.encrypted)t[o.substring(1)]=r;else for(var i in r){var a=o;"properties"!==i&&(a=a+"."+i),e(r[i],a)}}(e.properties,""),t}function p(e){var t=h(e);return Object.keys(t).length>0}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=[];if(Object.entries(e).forEach(function(e){var o=e[0],i=e[1],a="properties"===o?t:s.trimDots(t+"."+o);if(i.index&&r.push([a]),"object"===(void 0===i?"undefined":(0,n.default)(i))&&!Array.isArray(i)){var u=b(i,a);r=r.concat(u)}}),""===t){var o=e.compoundIndexes||[];r=r.concat(o)}return r=r.filter(function(e,t,r){return r.indexOf(e)===t})}function v(e){var t=Object.keys(e.properties).filter(function(t){return e.properties[t].primary}).shift();return t||"_id"}function y(e){return Object.keys(e.properties).filter(function(t){return e.properties[t].final})}function _(e){return s.sortObject((0,u.default)(e))}var m=function(e){return(e=(0,u.default)(e)).additionalProperties=!1,e.hasOwnProperty("disableKeyCompression")||(e.disableKeyCompression=!1),e.compoundIndexes=e.compoundIndexes||[],e.required=e.required||[],e.properties._rev={type:"string",minLength:1},e.properties._attachments={type:"object"},e.version=e.version||0,e};function g(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(0,f.runPluginHooks)("preCreateRxSchema",e);var t=new d(m(e));return(0,f.runPluginHooks)("createRxSchema",t),t}function w(e){return e instanceof d}r.default={RxSchema:d,getEncryptedPaths:h,hasCrypt:p,getIndexes:b,getPrimary:v,getFinalFields:y,normalize:_,create:g,isInstanceOf:w}},{"./hooks":7,"./rx-error":34,"./util":38,"babel-runtime/helpers/classCallCheck":50,"babel-runtime/helpers/createClass":51,"babel-runtime/helpers/typeof":56,clone:60,"object-path":503}],37:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PULL_TIME=r.EVENT_TTL=void 0;var n=d(e("babel-runtime/regenerator")),o=d(e("babel-runtime/helpers/asyncToGenerator")),i=d(e("babel-runtime/helpers/classCallCheck")),a=d(e("babel-runtime/helpers/createClass"));r.create=v;var u=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./util")),s=d(e("./rx-change-event")),c=d(e("./rx-broadcast-channel")),f=e("rxjs/Subject"),l=e("rxjs/operators/filter");function d(e){return e&&e.__esModule?e:{default:e}}var h="_local/last-change",p=c.default.canIUse()?2500:200,b=function(){function e(t){(0,i.default)(this,e),this._destroyed=!1,this.database=t,this.token=t.token,this.subs=[],this.pullCount=0,this.pull_running=!1,this.lastPull=(new Date).getTime(),this.lastTimestamp=0,this.receivedEvents={},this.bc=c.default.create(this.database,"socket"),this.messages$=new f.Subject}return(0,a.default)(e,[{key:"prepare",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pouch=this.database._spawnPouchDB("_socket",0,{auto_compaction:!1,revs_limit:1}),this.bc&&this.subs.push(this.bc.$.pipe((0,l.filter)(function(e){return"pull"===e.type})).subscribe(function(){return t.pull()})),(0,o.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t._destroyed){e.next=8;break}return e.next=3,u.promiseWait(p);case 3:if(!(t.messages$.observers.length>0)||t._destroyed){e.next=6;break}return e.next=6,t.pull();case 6:e.next=0;break;case 8:case"end":return e.stop()}},e,t)}))(),e.abrupt("return",this);case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"write",value:function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return delete(r=t.toJSON()).db,r._id=""+u.fastUnsecureHash(r)+r.t,e.next=5,this.database.lockedRun(function(){return o.pouch.put(r)});case 5:return e.next=7,this._updateLastTimestamp();case 7:if(e.t0=this.bc,!e.t0){e.next=11;break}return e.next=11,this.bc.write("pull");case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_getLastTimeDoc",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.database.lockedRun(function(){return r.pouch.get(h)});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",null);case 10:case"end":return e.stop()}},e,this,[[0,7]])}));return function(){return e.apply(this,arguments)}}()},{key:"_updateLastTimestamp",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,i=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=function(){var e=(0,o.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),e.next=3,i._getLastTimeDoc();case 3:if(r=e.sent){e.next=8;break}return e.abrupt("return",i.database.lockedRun(function(){return i.pouch.put({_id:h,time:t})}));case 8:return r.time=t,e.abrupt("return",i.database.lockedRun(function(){return i.pouch.put(r)}));case 10:case"end":return e.stop()}},e,i)}));return function(){return e.apply(this,arguments)}}(),r=!1;case 2:if(r){e.next=13;break}return e.prev=3,e.next=6,t();case 6:r=!0,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:e.next=2;break;case 13:case"end":return e.stop()}},e,this,[[3,9]])}));return function(){return e.apply(this,arguments)}}()},{key:"fetchDocs",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,o,i=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getLastTimeDoc();case 2:if(t=e.sent,r=t?t.time:0,!(this.lastTimestamp>=r)){e.next=8;break}return e.abrupt("return",[]);case 8:return this.lastTimestamp=r,e.next=11,this.database.lockedRun(function(){return i.pouch.allDocs({include_docs:!0})});case 11:return o=e.sent,e.abrupt("return",o.rows.map(function(e){return e.doc}));case 13:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"deleteDoc",value:function(){var e=(0,o.default)(n.default.mark(function e(t){var r,o=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,e.prev=1,e.next=4,this.database.lockedRun(function(){return o.pouch.remove(t)});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),r=!1;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}},e,this,[[1,6]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_cleanupDocs",value:function(e){var t=this;e.forEach(function(e){t.database.requestIdlePromise().then(function(){t._destroyed||t.deleteDoc(e)})}),e.length>0&&this.database.requestIdlePromise().then(function(){t._destroyed||t.database.lockedRun(function(){return t.pouch.compact()})})}},{key:"pull",value:function(){var e=(0,o.default)(n.default.mark(function e(){var t,r,o,i,a=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPulling){e.next=3;break}return this._repullAfter=!0,e.abrupt("return",!1);case 3:return this.isPulling=!0,this.pullCount++,e.next=7,u.requestIdlePromise(2500);case 7:if(!this._destroyed){e.next=9;break}return e.abrupt("return");case 9:return t=this.lastPull-100,this.lastPull=(new Date).getTime(),e.next=13,this.fetchDocs();case 13:if(r=e.sent,!this._destroyed){e.next=16;break}return e.abrupt("return");case 16:if(r.filter(function(e){return e.it!==a.token}).filter(function(e){return e.t>t}).sort(function(e,t){return e.t>t.t?1:-1}).map(function(e){return s.default.fromJSON(e)}).filter(function(e){return!a.receivedEvents[e.hash]&&(a.receivedEvents[e.hash]=(new Date).getTime())}).filter(function(e){return setTimeout(function(){return delete a.receivedEvents[e.hash]},15e3)}).forEach(function(e){return a.messages$.next(e)}),!this._destroyed){e.next=19;break}return e.abrupt("return");case 19:return o=(new Date).getTime()-5e3,i=r.filter(function(e){return e.t0&&void 0!==arguments[0]?arguments[0]:0;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return setTimeout(e,t)}));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),r.requestIdlePromise=function(){var e=(0,i.default)(o.default.mark(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("object"!==("undefined"==typeof window?"undefined":(0,n.default)(window))||!window.requestIdleCallback){e.next=4;break}return e.abrupt("return",new Promise(function(e){return window.requestIdleCallback(e,{timeout:t})}));case 4:return e.abrupt("return",new Promise(function(e){return setTimeout(e,0)}));case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}();r.isLevelDown=function(e){if(!e||"function"!=typeof e.super_||"function"!=typeof e.destroy)throw u.default.newRxError("UT4",{adapter:e})},r.fastUnsecureHash=function(e){"string"!=typeof e&&(e=JSON.stringify(e));var t=0,r=void 0,n=void 0,o=void 0;if(0===e.length)return t;for(r=0,o=e.length;r0);return t.reverse().map(function(e){return f[e]}).join("")},r.trimDots=function(e){for(;"."===e.charAt(0);)e=e.substr(1);for(;"."===e.slice(-1);)e=e.slice(0,-1);return e},r.validateCouchDBString=function(e){if("string"!=typeof e||0===e.length)throw u.default.newRxTypeError("UT1",{name:e});if(e.includes("/")||e.includes("\\"))return!0;var t="^[a-z][a-z0-9]*$",r=new RegExp(t);if(!e.match(r))throw new u.default.newRxError("UT2",{regex:t,givenName:e});return!0},r.sortObject=function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return t;if(!r&&Array.isArray(t))return t.sort(function(e,t){return"string"==typeof e&&"string"==typeof t?e.localeCompare(t):"object"===(void 0===e?"undefined":(0,n.default)(e))?1:-1}).map(function(t){return e(t)});if("object"===(void 0===t?"undefined":(0,n.default)(t))){if(t instanceof RegExp)return t;var o={};return Object.keys(t).sort(function(e,t){return e.localeCompare(t)}).forEach(function(r){o[r]=e(t[r])}),o}return t},r.stringifyFilter=function(e,t){return t instanceof RegExp?t.toString():t},r.pouchReplicationFunction=function(e,t){var r=t.pull,n=void 0===r||r,o=t.push,i=void 0===o||o;if(n&&i)return e.sync.bind(e);if(!n&&i)return e.replicate.to.bind(e);if(n&&!i)return e.replicate.from.bind(e);if(!n&&!i)throw u.default.newRxError("UT3",{pull:n,push:i})},r.randomCouchString=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t="",r="abcdefghijklmnopqrstuvwxyz",n=0;n=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}}}function g(e,t,r,n){var o=t&&t.prototype instanceof x?t:x,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return D()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=E(a,r);if(u){if(u===b)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=w(e,t,r);if("normal"===s.type){if(n=r.done?p:d,s.arg===b)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function w(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function x(){}function k(){}function j(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(t){function r(e,n,i,a){var u=w(t[e],t,n);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&o.call(c,"__await")?Promise.resolve(c.__await).then(function(e){r("next",e,i,a)},function(e){r("throw",e,i,a)}):Promise.resolve(c).then(function(e){s.value=e,i(s)},a)}a(u.arg)}"object"==typeof e.process&&e.process.domain&&(r=e.process.domain.bind(r));var n;this._invoke=function(e,t){function o(){return new Promise(function(n,o){r(e,t,n,o)})}return n=n?n.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,E(e,t),"throw"===t.method))return b;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return b}var o=w(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,b;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function R(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n0?s-4:s;var f=0;for(t=0;t>16&255,u[f++]=n>>8&255,u[f++]=255&n;2===a?(n=o[e.charCodeAt(t)]<<2|o[e.charCodeAt(t+1)]>>4,u[f++]=255&n):1===a&&(n=o[e.charCodeAt(t)]<<10|o[e.charCodeAt(t+1)]<<4|o[e.charCodeAt(t+2)]>>2,u[f++]=n>>8&255,u[f++]=255&n);return u},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i="",a=[],u=0,s=r-o;us?s:u+16383));1===o?(t=e[r-1],i+=n[t>>2],i+=n[t<<4&63],i+="=="):2===o&&(t=(e[r-2]<<8)+e[r-1],i+=n[t>>10],i+=n[t>>4&63],i+=n[t<<2&63],i+="=");return a.push(i),a.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function f(e,t,r){for(var o,i=[],a=t;a>18&63]+n[u>>12&63]+n[u>>6&63]+n[63&u]);var u;return i.join("")}},{}],59:[function(e,t,r){"use strict";var n=e("base64-js"),o=e("ieee754");r.Buffer=u,r.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(e){if(e>i)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=u.prototype,t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(e)}return s(e,t,r)}"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),u.poolSize=8192;function s(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return L(e)?function(e,t,r){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}u.isBuffer=function(e){return null!=e&&!0===e._isBuffer},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o>>1;case"base64":return I(e).length;default:if(n)return M(e).length;t=(""+t).toLowerCase(),n=!0}}u.byteLength=h;u.prototype._isBuffer=!0;function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return g(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return m(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var i=o-n,a=r-t,s=Math.min(i,a),c=this.slice(n,o),f=e.slice(t,r),l=0;l2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){var i=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,a/=2,u/=2,r/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}var c;if(o){var f=-1;for(c=r;ca&&(r=a-u),c=r;c>=0;c--){for(var l=!0,d=0;do&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return h=t,p=r,T(M(e,(d=this).length-h),d,h,p);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return c=this,f=t,l=r,T(I(e),c,f,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,s=r,T(function(e,t){for(var r,n,o,i=[],a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,(a=this).length-u),a,u,s);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}var a,u,s,c,f,l,d,h,p},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function g(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o239?4:i>223?3:i>191?2:1;if(o+u<=r){var s,c,f,l;switch(u){case 1:i<128&&(a=i);break;case 2:128==(192&(s=e[o+1]))&&(l=(31&i)<<6|63&s)>127&&(a=l);break;case 3:s=e[o+1],c=e[o+2],128==(192&s)&&128==(192&c)&&(l=(15&i)<<12|(63&s)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:s=e[o+1],c=e[o+2],f=e[o+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(l=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=u}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nn)&&(r=n);for(var o="",i=t;ir&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||S(e,t,this.length);for(var n=this[e],o=1,i=0;++i>>=0,t>>>=0,r||S(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUInt8=function(e,t){return e>>>=0,t||S(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||S(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||S(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||S(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||S(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||S(e,t,this.length);for(var n=this[e],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||S(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||S(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||S(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||S(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||S(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||S(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||S(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||S(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||S(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||S(e,8,this.length),o.read(this,e,!1,52,8)};function E(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){E(this,e,t,r,Math.pow(2,8*r)-1,0)}var o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){E(this,e,t,r,Math.pow(2,8*r)-1,0)}var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);E(this,e,t,r,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);E(this,e,t,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4};function C(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function A(e,t,r,n,i){return t=+t,r>>>=0,i||C(e,0,r,4),o.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(e,t,r){return A(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return A(this,e,t,!1,r)};function P(e,t,r,n,i){return t=+t,r>>>=0,i||C(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--o)e[o+t]=this[o+r];else if(i<1e3)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function I(e){return n.toByteArray(function(e){if((e=e.trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function L(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function F(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function q(e){return e!=e}},{"base64-js":58,ieee754:494}],60:[function(e,t,r){(function(e){var r=function(){"use strict";function t(e,t){return null!=t&&e instanceof t}var r;try{r=Map}catch(e){r=function(){}}var n;try{n=Set}catch(e){n=function(){}}var o;try{o=Promise}catch(e){o=function(){}}function i(a,s,c,f,l){"object"==typeof s&&(c=s.depth,f=s.prototype,l=s.includeNonEnumerable,s=s.circular);var d=[],h=[],p=void 0!==e;void 0===s&&(s=!0),void 0===c&&(c=1/0);return function a(c,b){if(null===c)return null;if(0===b)return c;var v,y;if("object"!=typeof c)return c;if(t(c,r))v=new r;else if(t(c,n))v=new n;else if(t(c,o))v=new o(function(e,t){c.then(function(t){e(a(t,b-1))},function(e){t(a(e,b-1))})});else if(i.__isArray(c))v=[];else if(i.__isRegExp(c))v=new RegExp(c.source,u(c)),c.lastIndex&&(v.lastIndex=c.lastIndex);else if(i.__isDate(c))v=new Date(c.getTime());else{if(p&&e.isBuffer(c))return v=new e(c.length),c.copy(v),v;t(c,Error)?v=Object.create(c):void 0===f?(y=Object.getPrototypeOf(c),v=Object.create(y)):(v=Object.create(f),y=f)}if(s){var _=d.indexOf(c);if(-1!=_)return h[_];d.push(c),h.push(v)}t(c,r)&&c.forEach(function(e,t){var r=a(t,b-1),n=a(e,b-1);v.set(r,n)}),t(c,n)&&c.forEach(function(e){var t=a(e,b-1);v.add(t)});for(var m in c){var g;y&&(g=Object.getOwnPropertyDescriptor(y,m)),g&&null==g.set||(v[m]=a(c[m],b-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(c);for(m=0;mf;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}}},{"./_to-absolute-index":131,"./_to-iobject":133,"./_to-length":134}],74:[function(e,t,r){var n=e("./_cof"),o=e("./_wks")("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?r:i?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},{"./_cof":75,"./_wks":140}],75:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],76:[function(e,t,r){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},{}],77:[function(e,t,r){"use strict";var n=e("./_object-dp"),o=e("./_property-desc");t.exports=function(e,t,r){t in e?n.f(e,t,o(0,r)):e[t]=r}},{"./_object-dp":108,"./_property-desc":120}],78:[function(e,t,r){var n=e("./_a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":69}],79:[function(e,t,r){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],80:[function(e,t,r){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":85}],81:[function(e,t,r){var n=e("./_is-object"),o=e("./_global").document,i=n(o)&&n(o.createElement);t.exports=function(e){return i?o.createElement(e):{}}},{"./_global":87,"./_is-object":96}],82:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],83:[function(e,t,r){var n=e("./_object-keys"),o=e("./_object-gops"),i=e("./_object-pie");t.exports=function(e){var t=n(e),r=o.f;if(r)for(var a,u=r(e),s=i.f,c=0;u.length>c;)s.call(e,a=u[c++])&&t.push(a);return t}},{"./_object-gops":113,"./_object-keys":116,"./_object-pie":117}],84:[function(e,t,r){var n=e("./_global"),o=e("./_core"),i=e("./_ctx"),a=e("./_hide"),u="prototype",s=function(e,t,r){var c,f,l,d=e&s.F,h=e&s.G,p=e&s.S,b=e&s.P,v=e&s.B,y=e&s.W,_=h?o:o[t]||(o[t]={}),m=_[u],g=h?n:p?n[t]:(n[t]||{})[u];h&&(r=t);for(c in r)(f=!d&&g&&void 0!==g[c])&&c in _||(l=f?g[c]:r[c],_[c]=h&&"function"!=typeof g[c]?r[c]:v&&f?i(l,n):y&&g[c]==l?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[u]=e[u],t}(l):b&&"function"==typeof l?i(Function.call,l):l,b&&((_.virtual||(_.virtual={}))[c]=l,e&s.R&&m&&!m[c]&&a(m,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},{"./_core":76,"./_ctx":78,"./_global":87,"./_hide":89}],85:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],86:[function(e,t,r){var n=e("./_ctx"),o=e("./_iter-call"),i=e("./_is-array-iter"),a=e("./_an-object"),u=e("./_to-length"),s=e("./core.get-iterator-method"),c={},f={};(r=t.exports=function(e,t,r,l,d){var h,p,b,v,y=d?function(){return e}:s(e),_=n(r,l,t?2:1),m=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(i(y)){for(h=u(e.length);h>m;m++)if((v=t?_(a(p=e[m])[0],p[1]):_(e[m]))===c||v===f)return v}else for(b=y.call(e);!(p=b.next()).done;)if((v=o(b,_,p.value,t))===c||v===f)return v}).BREAK=c,r.RETURN=f},{"./_an-object":72,"./_ctx":78,"./_is-array-iter":94,"./_iter-call":97,"./_to-length":134,"./core.get-iterator-method":141}],87:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],88:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],89:[function(e,t,r){var n=e("./_object-dp"),o=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},{"./_descriptors":80,"./_object-dp":108,"./_property-desc":120}],90:[function(e,t,r){var n=e("./_global").document;t.exports=n&&n.documentElement},{"./_global":87}],91:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":80,"./_dom-create":81,"./_fails":85}],92:[function(e,t,r){t.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},{}],93:[function(e,t,r){var n=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":75}],94:[function(e,t,r){var n=e("./_iterators"),o=e("./_wks")("iterator"),i=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||i[o]===e)}},{"./_iterators":102,"./_wks":140}],95:[function(e,t,r){var n=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":75}],96:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],97:[function(e,t,r){var n=e("./_an-object");t.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&n(i.call(e)),t}}},{"./_an-object":72}],98:[function(e,t,r){"use strict";var n=e("./_object-create"),o=e("./_property-desc"),i=e("./_set-to-string-tag"),a={};e("./_hide")(a,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n(a,{next:o(1,r)}),i(e,t+" Iterator")}},{"./_hide":89,"./_object-create":107,"./_property-desc":120,"./_set-to-string-tag":125,"./_wks":140}],99:[function(e,t,r){"use strict";var n=e("./_library"),o=e("./_export"),i=e("./_redefine"),a=e("./_hide"),u=e("./_has"),s=e("./_iterators"),c=e("./_iter-create"),f=e("./_set-to-string-tag"),l=e("./_object-gpo"),d=e("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(e,t,r,b,v,y,_){c(r,t,b);var m,g,w,x=function(e){if(!h&&e in S)return S[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},k=t+" Iterator",j="values"==v,O=!1,S=e.prototype,E=S[d]||S["@@iterator"]||v&&S[v],C=E||x(v),A=v?j?x("entries"):C:void 0,P="Array"==t?S.entries||E:E;if(P&&(w=l(P.call(new e)))!==Object.prototype&&w.next&&(f(w,k,!0),n||u(w,d)||a(w,d,p)),j&&E&&"values"!==E.name&&(O=!0,C=function(){return E.call(this)}),n&&!_||!h&&!O&&S[d]||a(S,d,C),s[t]=C,s[k]=p,v)if(m={values:j?C:x("values"),keys:y?C:x("keys"),entries:A},_)for(g in m)g in S||i(S,g,m[g]);else o(o.P+o.F*(h||O),t,m);return m}},{"./_export":84,"./_has":88,"./_hide":89,"./_iter-create":98,"./_iterators":102,"./_library":103,"./_object-gpo":114,"./_redefine":122,"./_set-to-string-tag":125,"./_wks":140}],100:[function(e,t,r){var n=e("./_wks")("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i=[7],a=i[n]();a.next=function(){return{done:r=!0}},i[n]=function(){return a},e(i)}catch(e){}return r}},{"./_wks":140}],101:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],102:[function(e,t,r){t.exports={}},{}],103:[function(e,t,r){t.exports=!0},{}],104:[function(e,t,r){var n=e("./_uid")("meta"),o=e("./_is-object"),i=e("./_has"),a=e("./_object-dp").f,u=0,s=Object.isExtensible||function(){return!0},c=!e("./_fails")(function(){return s(Object.preventExtensions({}))}),f=function(e){a(e,n,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,n)){if(!s(e))return"F";if(!t)return"E";f(e)}return e[n].i},getWeak:function(e,t){if(!i(e,n)){if(!s(e))return!0;if(!t)return!1;f(e)}return e[n].w},onFreeze:function(e){return c&&l.NEED&&s(e)&&!i(e,n)&&f(e),e}}},{"./_fails":85,"./_has":88,"./_is-object":96,"./_object-dp":108,"./_uid":137}],105:[function(e,t,r){var n=e("./_global"),o=e("./_task").set,i=n.MutationObserver||n.WebKitMutationObserver,a=n.process,u=n.Promise,s="process"==e("./_cof")(a);t.exports=function(){var e,t,r,c=function(){var n,o;for(s&&(n=a.domain)&&n.exit();e;){o=e.fn,e=e.next;try{o()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(s)r=function(){a.nextTick(c)};else if(i){var f=!0,l=document.createTextNode("");new i(c).observe(l,{characterData:!0}),r=function(){l.data=f=!f}}else if(u&&u.resolve){var d=u.resolve();r=function(){d.then(c)}}else r=function(){o.call(n,c)};return function(n){var o={fn:n,next:void 0};t&&(t.next=o),e||(e=o,r()),t=o}}},{"./_cof":75,"./_global":87,"./_task":130}],106:[function(e,t,r){"use strict";var n=e("./_a-function");t.exports.f=function(e){return new function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},{"./_a-function":69}],107:[function(e,t,r){var n=e("./_an-object"),o=e("./_object-dps"),i=e("./_enum-bug-keys"),a=e("./_shared-key")("IE_PROTO"),u=function(){},s=function(){var t,r=e("./_dom-create")("iframe"),n=i.length;for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",(t=r.contentWindow.document).open(),t.write(" diff --git a/docs/custom-build.html b/docs/custom-build.html index cefcff55ca7..bc8657d9154 100644 --- a/docs/custom-build.html +++ b/docs/custom-build.html @@ -1339,7 +1339,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Custom Build","level":"3.10","depth":1,"next":{"title":"Plugins","level":"3.11","depth":1,"path":"plugins.md","ref":"./plugins.md","articles":[]},"previous":{"title":"LocalDocuments","level":"3.9","depth":1,"path":"rx-local-document.md","ref":"./rx-local-document.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"custom-build.md","mtime":"2017-12-18T18:53:32.275Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Custom Build","level":"3.10","depth":1,"next":{"title":"Plugins","level":"3.11","depth":1,"path":"plugins.md","ref":"./plugins.md","articles":[]},"previous":{"title":"LocalDocuments","level":"3.9","depth":1,"path":"rx-local-document.md","ref":"./rx-local-document.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"custom-build.md","mtime":"2017-12-18T18:53:32.275Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/data-migration.html b/docs/data-migration.html index 9dffde3dbf0..396b4d27ed6 100644 --- a/docs/data-migration.html +++ b/docs/data-migration.html @@ -1300,7 +1300,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"DataMigration","level":"3.4","depth":1,"next":{"title":"LeaderElection","level":"3.5","depth":1,"path":"leader-election.md","ref":"./leader-election.md","articles":[]},"previous":{"title":"Population","level":"3.3","depth":1,"path":"population.md","ref":"./population.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"data-migration.md","mtime":"2017-12-18T18:53:32.275Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"DataMigration","level":"3.4","depth":1,"next":{"title":"LeaderElection","level":"3.5","depth":1,"path":"leader-election.md","ref":"./leader-election.md","articles":[]},"previous":{"title":"Population","level":"3.3","depth":1,"path":"population.md","ref":"./population.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"data-migration.md","mtime":"2017-12-18T18:53:32.275Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/in-memory.html b/docs/in-memory.html index f63575c1ee3..5a002648087 100644 --- a/docs/in-memory.html +++ b/docs/in-memory.html @@ -1219,7 +1219,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"InMemory","level":"3.8","depth":1,"next":{"title":"LocalDocuments","level":"3.9","depth":1,"path":"rx-local-document.md","ref":"./rx-local-document.md","articles":[]},"previous":{"title":"QueryChangeDetection","level":"3.7","depth":1,"path":"query-change-detection.md","ref":"./query-change-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"in-memory.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"InMemory","level":"3.8","depth":1,"next":{"title":"LocalDocuments","level":"3.9","depth":1,"path":"rx-local-document.md","ref":"./rx-local-document.md","articles":[]},"previous":{"title":"QueryChangeDetection","level":"3.7","depth":1,"path":"query-change-detection.md","ref":"./query-change-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"in-memory.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/index.html b/docs/index.html index 3ea3b21c034..1c082dd094e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1206,7 +1206,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Install","level":"1.2","depth":1,"path":"install.md","ref":"./install.md","articles":[{"title":"npm","level":"1.2.1","depth":2,"anchor":"#npm","path":"install.md","ref":"./install.md#npm","articles":[]},{"title":"import","level":"1.2.2","depth":2,"anchor":"#import","path":"install.md","ref":"./install.md#import","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"README.md","mtime":"2017-12-18T18:53:27.799Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Install","level":"1.2","depth":1,"path":"install.md","ref":"./install.md","articles":[{"title":"npm","level":"1.2.1","depth":2,"anchor":"#npm","path":"install.md","ref":"./install.md#npm","articles":[]},{"title":"import","level":"1.2.2","depth":2,"anchor":"#import","path":"install.md","ref":"./install.md#import","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"README.md","mtime":"2017-12-18T18:53:27.799Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/install.html b/docs/install.html index cd2cb21f058..932470aef77 100644 --- a/docs/install.html +++ b/docs/install.html @@ -1236,7 +1236,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Install","level":"1.2","depth":1,"next":{"title":"npm","level":"1.2.1","depth":2,"anchor":"#npm","path":"install.md","ref":"./install.md#npm","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"install.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Install","level":"1.2","depth":1,"next":{"title":"npm","level":"1.2.1","depth":2,"anchor":"#npm","path":"install.md","ref":"./install.md#npm","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"install.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/leader-election.html b/docs/leader-election.html index c4d48f03952..ef1afd48a53 100644 --- a/docs/leader-election.html +++ b/docs/leader-election.html @@ -1227,7 +1227,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"LeaderElection","level":"3.5","depth":1,"next":{"title":"Replication","level":"3.6","depth":1,"path":"replication.md","ref":"./replication.md","articles":[]},"previous":{"title":"DataMigration","level":"3.4","depth":1,"path":"data-migration.md","ref":"./data-migration.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"leader-election.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"LeaderElection","level":"3.5","depth":1,"next":{"title":"Replication","level":"3.6","depth":1,"path":"replication.md","ref":"./replication.md","articles":[]},"previous":{"title":"DataMigration","level":"3.4","depth":1,"path":"data-migration.md","ref":"./data-migration.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"leader-election.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/middleware.html b/docs/middleware.html index 4f0cf1ac2b0..5c4eedf2d14 100644 --- a/docs/middleware.html +++ b/docs/middleware.html @@ -1386,7 +1386,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Middleware-hooks","level":"3.1","depth":1,"next":{"title":"ORM/DRM","level":"3.2","depth":1,"path":"orm.md","ref":"./orm.md","articles":[]},"previous":{"title":"RxAttachment","level":"2.4","depth":1,"path":"rx-attachment.md","ref":"./rx-attachment.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"middleware.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Middleware-hooks","level":"3.1","depth":1,"next":{"title":"ORM/DRM","level":"3.2","depth":1,"path":"orm.md","ref":"./orm.md","articles":[]},"previous":{"title":"RxAttachment","level":"2.4","depth":1,"path":"rx-attachment.md","ref":"./rx-attachment.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"middleware.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/orm.html b/docs/orm.html index c03a7f5f902..cfa71b680da 100644 --- a/docs/orm.html +++ b/docs/orm.html @@ -1273,7 +1273,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"ORM/DRM","level":"3.2","depth":1,"next":{"title":"Population","level":"3.3","depth":1,"path":"population.md","ref":"./population.md","articles":[]},"previous":{"title":"Middleware-hooks","level":"3.1","depth":1,"path":"middleware.md","ref":"./middleware.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"orm.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"ORM/DRM","level":"3.2","depth":1,"next":{"title":"Population","level":"3.3","depth":1,"path":"population.md","ref":"./population.md","articles":[]},"previous":{"title":"Middleware-hooks","level":"3.1","depth":1,"path":"middleware.md","ref":"./middleware.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"orm.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/plugins.html b/docs/plugins.html index 8c7bd5bbbc6..04eea7c13eb 100644 --- a/docs/plugins.html +++ b/docs/plugins.html @@ -1259,7 +1259,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Plugins","level":"3.11","depth":1,"next":{"title":"Contribute","level":"3.12","depth":1,"path":"contribute.md","ref":"./contribute.md","articles":[]},"previous":{"title":"Custom Build","level":"3.10","depth":1,"path":"custom-build.md","ref":"./custom-build.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"plugins.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Plugins","level":"3.11","depth":1,"next":{"title":"Contribute","level":"3.12","depth":1,"path":"contribute.md","ref":"./contribute.md","articles":[]},"previous":{"title":"Custom Build","level":"3.10","depth":1,"path":"custom-build.md","ref":"./custom-build.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"plugins.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/population.html b/docs/population.html index 260892675e0..2a551f26d50 100644 --- a/docs/population.html +++ b/docs/population.html @@ -1181,7 +1181,7 @@

via method

console.dir(bestFriend); //> RxDocument[Alice]

via getter

-

You can also get the populated RxDocument with the direct getter. Therefore you have to add the underscore _ to the fieldname. +

You can also get the populated RxDocument with the direct getter. Therefore you have to add an underscore suffix _ to the fieldname. This works also on nested values.

await humansCollection.insert({
   name: 'Alice',
@@ -1302,7 +1302,7 @@ 

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Population","level":"3.3","depth":1,"next":{"title":"DataMigration","level":"3.4","depth":1,"path":"data-migration.md","ref":"./data-migration.md","articles":[]},"previous":{"title":"ORM/DRM","level":"3.2","depth":1,"path":"orm.md","ref":"./orm.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"population.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Population","level":"3.3","depth":1,"next":{"title":"DataMigration","level":"3.4","depth":1,"path":"data-migration.md","ref":"./data-migration.md","articles":[]},"previous":{"title":"ORM/DRM","level":"3.2","depth":1,"path":"orm.md","ref":"./orm.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"population.md","mtime":"2018-01-10T17:35:33.441Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/query-change-detection.html b/docs/query-change-detection.html index 5a5f1fddccd..fe55bccfb0f 100644 --- a/docs/query-change-detection.html +++ b/docs/query-change-detection.html @@ -1214,7 +1214,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"QueryChangeDetection","level":"3.7","depth":1,"next":{"title":"InMemory","level":"3.8","depth":1,"path":"in-memory.md","ref":"./in-memory.md","articles":[]},"previous":{"title":"Replication","level":"3.6","depth":1,"path":"replication.md","ref":"./replication.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"query-change-detection.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"QueryChangeDetection","level":"3.7","depth":1,"next":{"title":"InMemory","level":"3.8","depth":1,"path":"in-memory.md","ref":"./in-memory.md","articles":[]},"previous":{"title":"Replication","level":"3.6","depth":1,"path":"replication.md","ref":"./replication.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"query-change-detection.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/replication.html b/docs/replication.html index b26411bfbd4..5c24c84a097 100644 --- a/docs/replication.html +++ b/docs/replication.html @@ -1240,7 +1240,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Replication","level":"3.6","depth":1,"next":{"title":"QueryChangeDetection","level":"3.7","depth":1,"path":"query-change-detection.md","ref":"./query-change-detection.md","articles":[]},"previous":{"title":"LeaderElection","level":"3.5","depth":1,"path":"leader-election.md","ref":"./leader-election.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"replication.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Replication","level":"3.6","depth":1,"next":{"title":"QueryChangeDetection","level":"3.7","depth":1,"path":"query-change-detection.md","ref":"./query-change-detection.md","articles":[]},"previous":{"title":"LeaderElection","level":"3.5","depth":1,"path":"leader-election.md","ref":"./leader-election.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"replication.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-attachment.html b/docs/rx-attachment.html index dd221cfb412..1500f744798 100644 --- a/docs/rx-attachment.html +++ b/docs/rx-attachment.html @@ -1263,7 +1263,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxAttachment","level":"2.4","depth":1,"next":{"title":"Middleware-hooks","level":"3.1","depth":1,"path":"middleware.md","ref":"./middleware.md","articles":[]},"previous":{"title":"update()","level":"2.3.2","depth":2,"anchor":"#update","path":"rx-query.md","ref":"./rx-query.md#update","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-attachment.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxAttachment","level":"2.4","depth":1,"next":{"title":"Middleware-hooks","level":"3.1","depth":1,"path":"middleware.md","ref":"./middleware.md","articles":[]},"previous":{"title":"update()","level":"2.3.2","depth":2,"anchor":"#update","path":"rx-query.md","ref":"./rx-query.md#update","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-attachment.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-collection.html b/docs/rx-collection.html index e940a2ef769..231037a6db1 100644 --- a/docs/rx-collection.html +++ b/docs/rx-collection.html @@ -1327,7 +1327,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxCollection","level":"2.1","depth":1,"next":{"title":"Creation","level":"2.1.1","depth":2,"anchor":"#creating-a-collection","path":"rx-collection.md","ref":"./rx-collection.md#creating-a-collection","articles":[{"title":"name","level":"2.1.1.1","depth":3,"anchor":"#name","path":"rx-collection.md","ref":"./rx-collection.md#name","articles":[]},{"title":"schema","level":"2.1.1.2","depth":3,"anchor":"#schema","path":"rx-collection.md","ref":"./rx-collection.md#schema","articles":[]}]},"previous":{"title":"default","level":"1.4.6","depth":2,"anchor":"#default","path":"rx-schema.md","ref":"./rx-schema.md#default","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-collection.md","mtime":"2017-12-29T17:13:49.778Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxCollection","level":"2.1","depth":1,"next":{"title":"Creation","level":"2.1.1","depth":2,"anchor":"#creating-a-collection","path":"rx-collection.md","ref":"./rx-collection.md#creating-a-collection","articles":[{"title":"name","level":"2.1.1.1","depth":3,"anchor":"#name","path":"rx-collection.md","ref":"./rx-collection.md#name","articles":[]},{"title":"schema","level":"2.1.1.2","depth":3,"anchor":"#schema","path":"rx-collection.md","ref":"./rx-collection.md#schema","articles":[]}]},"previous":{"title":"default","level":"1.4.6","depth":2,"anchor":"#default","path":"rx-schema.md","ref":"./rx-schema.md#default","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-collection.md","mtime":"2017-12-29T17:13:49.778Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-database.html b/docs/rx-database.html index 84e243b6412..9fb767128e8 100644 --- a/docs/rx-database.html +++ b/docs/rx-database.html @@ -1295,7 +1295,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxDatabase","level":"1.3","depth":1,"next":{"title":"Creation","level":"1.3.1","depth":2,"anchor":"#creation","path":"rx-database.md","ref":"./rx-database.md#creation","articles":[{"title":"name","level":"1.3.1.1","depth":3,"anchor":"#name","path":"rx-database.md","ref":"./rx-database.md#name","articles":[]},{"title":"adapter","level":"1.3.1.2","depth":3,"anchor":"#adapter","path":"rx-database.md","ref":"./rx-database.md#adapter","articles":[]},{"title":"password","level":"1.3.1.3","depth":3,"anchor":"#password","path":"rx-database.md","ref":"./rx-database.md#password","articles":[]},{"title":"multiInstance","level":"1.3.1.4","depth":3,"anchor":"#multiinstance","path":"rx-database.md","ref":"./rx-database.md#multiinstance","articles":[]},{"title":"ignoreDuplicate","level":"1.3.1.5","depth":3,"anchor":"#ignoreduplicate","path":"rx-database.md","ref":"./rx-database.md#ignoreduplicate","articles":[]}]},"previous":{"title":"import","level":"1.2.2","depth":2,"anchor":"#import","path":"install.md","ref":"./install.md#import","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-database.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxDatabase","level":"1.3","depth":1,"next":{"title":"Creation","level":"1.3.1","depth":2,"anchor":"#creation","path":"rx-database.md","ref":"./rx-database.md#creation","articles":[{"title":"name","level":"1.3.1.1","depth":3,"anchor":"#name","path":"rx-database.md","ref":"./rx-database.md#name","articles":[]},{"title":"adapter","level":"1.3.1.2","depth":3,"anchor":"#adapter","path":"rx-database.md","ref":"./rx-database.md#adapter","articles":[]},{"title":"password","level":"1.3.1.3","depth":3,"anchor":"#password","path":"rx-database.md","ref":"./rx-database.md#password","articles":[]},{"title":"multiInstance","level":"1.3.1.4","depth":3,"anchor":"#multiinstance","path":"rx-database.md","ref":"./rx-database.md#multiinstance","articles":[]},{"title":"ignoreDuplicate","level":"1.3.1.5","depth":3,"anchor":"#ignoreduplicate","path":"rx-database.md","ref":"./rx-database.md#ignoreduplicate","articles":[]}]},"previous":{"title":"import","level":"1.2.2","depth":2,"anchor":"#import","path":"install.md","ref":"./install.md#import","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-database.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-document.html b/docs/rx-document.html index a4c8d155c24..1079a8ed113 100644 --- a/docs/rx-document.html +++ b/docs/rx-document.html @@ -1403,7 +1403,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxDocument","level":"2.2","depth":1,"next":{"title":"Insert","level":"2.2.1","depth":2,"anchor":"#insert","path":"rx-document.md","ref":"./rx-document.md#insert","articles":[]},"previous":{"title":"remove()","level":"2.1.2.11","depth":3,"anchor":"#clear","path":"rx-collection.md","ref":"./rx-collection.md#clear","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-document.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxDocument","level":"2.2","depth":1,"next":{"title":"Insert","level":"2.2.1","depth":2,"anchor":"#insert","path":"rx-document.md","ref":"./rx-document.md#insert","articles":[]},"previous":{"title":"remove()","level":"2.1.2.11","depth":3,"anchor":"#clear","path":"rx-collection.md","ref":"./rx-collection.md#clear","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-document.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-local-document.html b/docs/rx-local-document.html index a93744cbc31..41ae0281dbb 100644 --- a/docs/rx-local-document.html +++ b/docs/rx-local-document.html @@ -1253,7 +1253,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"LocalDocuments","level":"3.9","depth":1,"next":{"title":"Custom Build","level":"3.10","depth":1,"path":"custom-build.md","ref":"./custom-build.md","articles":[]},"previous":{"title":"InMemory","level":"3.8","depth":1,"path":"in-memory.md","ref":"./in-memory.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-local-document.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"LocalDocuments","level":"3.9","depth":1,"next":{"title":"Custom Build","level":"3.10","depth":1,"path":"custom-build.md","ref":"./custom-build.md","articles":[]},"previous":{"title":"InMemory","level":"3.8","depth":1,"path":"in-memory.md","ref":"./in-memory.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-local-document.md","mtime":"2017-12-18T18:53:32.279Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-query.html b/docs/rx-query.html index 8cabb30b351..870a3925431 100644 --- a/docs/rx-query.html +++ b/docs/rx-query.html @@ -1224,7 +1224,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxQuery","level":"2.3","depth":1,"next":{"title":"remove()","level":"2.3.1","depth":2,"anchor":"#remove","path":"rx-query.md","ref":"./rx-query.md#remove","articles":[]},"previous":{"title":"$()","level":"2.2.3.7","depth":3,"anchor":"#observe-","path":"rx-document.md","ref":"./rx-document.md#observe-","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-query.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxQuery","level":"2.3","depth":1,"next":{"title":"remove()","level":"2.3.1","depth":2,"anchor":"#remove","path":"rx-query.md","ref":"./rx-query.md#remove","articles":[]},"previous":{"title":"$()","level":"2.2.3.7","depth":3,"anchor":"#observe-","path":"rx-document.md","ref":"./rx-document.md#observe-","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-query.md","mtime":"2017-12-18T18:53:27.839Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/rx-schema.html b/docs/rx-schema.html index 0f57c6f685d..9f82bf9a7e6 100644 --- a/docs/rx-schema.html +++ b/docs/rx-schema.html @@ -1354,7 +1354,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"RxSchema","level":"1.4","depth":1,"next":{"title":"Example","level":"1.4.1","depth":2,"anchor":"#example","path":"rx-schema.md","ref":"./rx-schema.md#example","articles":[]},"previous":{"title":"checkAdapter()","level":"1.3.2.8","depth":3,"anchor":"#checkadapter","path":"rx-database.md","ref":"./rx-database.md#checkadapter","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-schema.md","mtime":"2017-12-29T16:33:56.263Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-03T16:01:31.938Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"RxSchema","level":"1.4","depth":1,"next":{"title":"Example","level":"1.4.1","depth":2,"anchor":"#example","path":"rx-schema.md","ref":"./rx-schema.md#example","articles":[]},"previous":{"title":"checkAdapter()","level":"1.3.2.8","depth":3,"anchor":"#checkadapter","path":"rx-database.md","ref":"./rx-database.md#checkadapter","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","custom-favicon","-sharing"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/pubkey/rxdb"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./files/logo/icon.ico","custom-favicon":{},"edit-link":{"label":"Edit This Page","base":"https://github.com/pubkey/rxdb/tree/master/docs-src"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"RxDB - Documentation","links":{"sidebar":{"Follow @twitter ":"https://twitter.com/rxdbjs","Chat @gitter ":"https://gitter.im/pubkey/rxdb","Star @github ":"https://github.com/pubkey/rxdb"}},"gitbook":"3.2.2"},"file":{"path":"rx-schema.md","mtime":"2017-12-29T16:33:56.263Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-01-25T16:58:35.871Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/search_index.json b/docs/search_index.json index 6e5088e1bf2..9eddcef1f26 100644 --- a/docs/search_index.json +++ b/docs/search_index.json @@ -1 +1 @@ -{"index":{"version":"0.5.12","fields":[{"name":"title","boost":10},{"name":"keywords","boost":15},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"./":[">","client","databas","first","here.","introduct","javascript.","new","offlin","reactive,","rxdb,","serverless,","side,","start"],"install.html":["\"dependencies\":","\"git+https://git@github.com/pubkey/rxdb.git#commithash\"","\"rxdb\":","'babel","'rxdb';","'rxjs';","'rxjs/add/operator/filter';","'rxjs/add/operator/first';","'rxjs/add/operator/map';","'rxjs/add/operator/mergemap';","'rxjs/operators/filter';","'rxjs/subject';","//","=","add","addit","altern","anoth","babel","before.","browsers.","build","cherri","code","commit.","commithash","continu","default","depend","develop","es5","es5.","es6","es8","file:","filter","full","git","hash","here","import","includ","instal","javascript","latest","lettabl","lib,","mean","need","new","npm","older","operators,","operators.","package.json,","package.json.","part","peer","pick","polyfil","polyfill');","polyfill';","polyfill.","polyfills,","reduc","releas","replac","requir","require('babel","require('rxdb');","require('rxjs');","run:","rxdb","rxdb,","rxdb.","rxj","rxjs'","save","size,","state","subject","support","transpil","us","var","want","whole","{","}"],"rx-database.html":["$","'heroesdb',","'localstorage');","'memdown';","'mydatabase',","'websql',","(optional)","(optional=false)","(optional=true)","*/).then(()",".create()",".then(()",".then(json","/*","//","12","4","=","=>","actual","ad","adapt","adapter,","adapter:","adapters.","add","affect","allow","app","app,","app.","assum","asynchron","at.","await","becom","befor","between","browsers,","call","case","chang","characters.","check","checkadapter()","cleanup","collect","common","console.dir(changeevent));","console.dir(json));","console.dir(ok);","console.log('done'));","const","contain","continu","cordova","cpu.","creat","creation","current","data","data.","databas","database,","database.","db","db1","db2","decrypt","defin","depend","destroy","destroy()","destroyed.","document.","done","dump","dump()","each","elect","electron","emptydatabase.importdump(json)","enabl","encrypt","environment.","equal","error","event","events.","exampl","explicitli","export","fals","field","folder","follow","free","function","function.","given","gone","handl","here","identifi","idl","idle.","ignoredupl","ignoreduplicate:","import","importdump()","instanc","instance.","instead","intent","isrxdatabas","it'","it.","javascript","json","leader.","level","leveldb","leveldb'));","localstorage'));","main","memdown","memdown});","memori","mistake,","module.","moment","more","ms","multiinst","multipl","mycollection.customcleanupfunction();","mydatabase.destroy();","mydatabase.dump()","mydatabase.dump(true)","mydatabase.remove();","mydatabase.requestidlepromise().then(()","mydatabase.requestidlepromise(1000","mydb.$.subscribe(changeev","name","name:","nativ","ness","new","nodej","not.","noth","notice:","now","object","observ","ok","on","other.","paramet","parameters.","pass","password","piec","pouchdb","prevent","process,","promis","rare","react","remov","remove()","replications.","requestidlecallback","requestidlepromise()","resolv","return","run","runtime,","rxdatabas","rxdatabase.","rxdb","rxdb,","rxdb.checkadapter('localstorage');","rxdb.create({","rxdb.create({name:","rxdb.isrxdatabase(myobj);","rxdb.plugin()","rxdb.plugin(require('pouchdb","rxdb.removedatabase('mydatabasename',","rxj","same","semi","serverless.","set","share","similar","singl","someth","speed","stop","storag","storage.","store","stream","string","synchronis","task","tasks.","tests,","this.","throw","time","timeout","track","true","true.","two","uniqu","unit","up","us","veri","waitforleadership()","want","window","without","work","wrong.","{","});"],"rx-schema.html":["\"array\",","\"birthyear\":","\"color\":","\"damage\":","\"describ","\"description\":","\"encrypted\":","\"final\":","\"healthpoints\":","\"hero","\"item\":","\"max\":","\"maxitems\":","\"min\":","\"name\":","\"number\"","\"number\",","\"object\",","\"primary\":","\"properties\":","\"required\":","\"secret\":","\"skills\":","\"string\"","\"string\",","\"title\":","\"type\":","\"uniqueitems\":","\"version\":","'heroes',","'human","'integer',","'lastname']","'object',","'string'","'string',","//","0","0,","0.","100","1900,","20","2050","5","5,","9]$","9_]*]?[a","=","[\"color\"]","['firstname',","^[a","`queri","accident","add","additionalproperti","advantages:","age:","allow","alway","anyth","anyway","array","attribut","attribute.","await","befor","between","birthyear","chang","change.","collect","collection.","color","compound","compoundindex","compression',","compression,","conform","console.dir(mydatabase.heroes.name);","const","contain","continu","creat","damag","data","database,","default","default:","defin","definit","definition.","detection`,","dev","disabl","disablekeycompress","disablekeycompression:","document","document,","document.","don't","done","enabl","encrypt","encrypted.","ensur","error","everyth","exampl","example,","false.","field","fieldnam","fieldnames,","fields.","fill","final","final,","final:","find","first","firstname:","follow","getter","greater","healthpoint","here","hero","hero\",","hero.","improv","index","index,","index:","indexed,","indexes,","insert","insid","instantli","integ","intern","invalid","it.","json","jsonschema","key","keycompress","lastname:","later.","learn","level","looks.","make","map","match","maximum","mean","migrationstrategi","modifi","mydatabase.collection({","myheroschema","myschema","name","name:","new","new.","notic","notice:","number","number,","object","observ","options.","pass","per","perform","popul","primary,","primary.","properti","properties:","provid","regex","requir","required.","required:","rxdb","rxdb,","rxschema","schema","schema\",","schema.","schema.org.","schema:","schemawithdefaultag","schemawithfinalag","schemawithindex","secondari","secret","set","settings:","simpl","singl","skill","spec","standard","start","store","string","string,","support","sure","team","temporari","therefor","things.","throw","title:","top","true","true,","true.","type","type:","unique,","unset","us","valid","valu","values.","version","version:","want","whenev","within","worry,","written","z0","z][[a","za","{","}","});","},","};"],"rx-collection.html":["$","'bar'","'bar2'","'bob'","'bob',","'foo',","'foo'}})","'heroes',","'humans',","'kelso'","'kelso';",".collection()",".exec().then(doc",".exec().then(docu",".then(()",".then(collect",".then(json",".upsert()","//","409","77;","9]*$.","=","==","=>",">","^[a","abov","allow","atom","atomicupsert()","automat","await","basic","befor","behavior","between","call","chain","chang","collect","collection'","collection,","collection.","collection2","collection2);","conflict","console.dir(changeevent));","console.dir(collection));","console.dir(doc));","console.dir(documents));","console.dir(json));","console.log('done'));","console.log(collect","const","continu","couchdb","creat","data","data.","databas","database,","database.","database:","db.collection({","db.heroes;","db['heroes']","decrypt","defin","destroy","destroy()","differ","directli","doc","docdata","document","document,","document.","documents,","documents.","does,","dump","dump()","easily.","encrypt","error.","errors,","especi","exec","exist","export","fals","field","fields.","fill","find","find()","findone()","finish","firstname:","follow","form","free","full","function","function.","generated.","given","handled.","help","here","here.","ident","identifi","import","importdump()","insert","insert()","instanc","instance.","isrxcollect","it.","javascript","json","known","last","lastname:","later","look","mani","match","mean","memori","method","method.","more","mycollection.$.subscribe(changeev","mycollection.atomicupsert(docdata);","mycollection.dump()","mycollection.dump(true)","mycollection.find().where('name').eq('foo')","mycollection.find({name:","mycollection.findone('foo')","mycollection.findone().where('name').eq('foo')","mycollection.importdump(json)","mycollection.insert({","mycollection.newdocument({","mycollection.remove();","mycollection.upsert(docdata);","mycollection.upsert({","mydatabase.collection({","mydatabase.destroy();","myschema","name","name.","name:","name:foobar","need","never","new","newdocument()","newli","not.","now","object","observ","older","oper","operations.","option","orm","otherwis","overwrit","overwritten","paramet","parrallel","pass","pouchdb","pouchset","prefil","prevent","previou","primari","primary,","property.","protocol.","queri","re","refind","regex:","remov","remove()","replic","replications.","return","run","running.","rxcollect","rxcollection.","rxcollection.newdocument(initaldata).","rxcollections,","rxdatabas","rxdb,","rxdb.isrxcollection(myobj);","rxdocument","rxdocument.","rxdocument.atomicupdate.","rxj","rxqueri","rxschema","rxschema.","same","save","schema","schema:","schemas,","schemaversions.","search","server","set","short","similar","simpl","singl","sometim","spawn","standard","still","stop","store","stream","support","sync","sync()","tempdoc","tempdoc.ag","tempdoc.lastnam","tempdoc.save();","temporari","through","throw","timespan,","transform","tri","true","two","type","type.","uniqu","until","up","updat","upsert","upsert()","us","valid","valu","veri","versions.","wait","want","within","work","z0","z][a","{","{$eq:","})","});","};"],"rx-document.html":["![synced.gif](files/synced.gif)","$","$inc:","$set:","'alice'","'bar'","'barfoo';","'foo',","'foobar'","'foobar');","'foobar';","'foobar2'","'foobar2');","'foobar2';","'name'","($)","(synced$","(via",".find()",".insert()",".save()",".subscribe(changeev",".subscribe(newnam","//","1","2","4","409","=","=>","[1,2,3,4].foreach(nr","```","```html","access","ad","ag","age:","alic","angular","anyth","argument,","atom","atomicupdate()","atomicupdate:","automat","await","b","base","befor","belong","boolean","browser","call","chang","changed.","changeev","changes.","click","collection'","collection,","collection.","compar","conflict","console.dir(changeevent));","console.dir(currentname);","console.dir(currentnestedvalue);","console.dir(documents));","console.dir(isname);","console.dir(mydocument.age);","console.log(laststate);","console.log(mydocument.deleted);","console.log(mydocument.firstname);","console.log(mydocument.get('firstname'));","console.log(mydocument.synced);","const","continu","current","currentnam","currentname;","currentnestedvalu","currentnestedvalue;","data","databas","database.","decrypt","delet","deleted$","deleted$.","depend","directli","directly.","doc.ag","document","document,","document.","dollarsign","each","edit","emit","encrypted,","error.","error:","errors,","event","exampl","fals","false),","field","fieldnam","find","finished.","fire","firstnam","fistname:","foobar","function","function.","get$","get$()","get()","getter","given","happen","here","ident","increas","insert","instanc","instead","isnam","isname;","isrxdocu","lastname:","lastpromis","lastpromise;","laststat","level","life","mani","mean","modifi","modifyjs.","mongo","more","mycollection.find().exec()","mycollection.insert({","mydocument.$()","mydocument.ag","mydocument.atomicupdate(function(doc){","mydocument.deleted$.subscribe(st","mydocument.firstnam","mydocument.firstname$","mydocument.get$('name')","mydocument.get('name');","mydocument.nam","mydocument.name;","mydocument.remove();","mydocument.resync();","mydocument.save();","mydocument.set('firstname',","mydocument.set('name',","mydocument.synced$.subscribe(st","mydocument.update({","mydocument.whatever.nestedfield","mydocument.whatever.nestedfield$","mydocument.whatever.nestedfield;","name","name.","name:","nest","nestedvalu","new","newname;","not.","note","notifi","now","nr;","null;","object","object,","observ","oper","operations.","overwrit","parameter.","path","prevent","previou","promis","proxi","record","relat","remov","remove()","reproduc","resync","resync()","return","returning.","run","running.","rxdb,","rxdb.isrxdocument(myobj);","rxdocument","rxdocument.","rxj","same","save","save()","save().","save,","set","set()","set).","short","show","singl","someon","state","state);","still","storag","store","submit","sync","synced$","synced$.","syntax,","tab","table.","take","throw","time","time.","timespan,","top","transform","true","two","type","updat","update()","us","usag","user","valu","value,","value.","values.","var","veri","warn","warning:","whether","wrap","{","}","});","},"],"rx-query.html":["$inc:",".where()","//","1","18","=","afterwards.","ag","age:","await","chain","chang","changed.","collect","collection.","console.dir(results);","const","continu","creat","database,","defin","delet","document","documents.","example:","fals","field.","find","found","function","given","heavi","here","immut","immutable.","increas","instanc","instead","isrxqueri","it,","keep","less","means,","mind","modifi","mycollection.find().where('age').gt(18);","mycollection.find().where('age').lt(18);","name","new","not.","notice:","now","object","object,","on","optimis","origin","over","perform","previou","promis","queri","queries.","query.remove();","query.update({","queryobject","queryobject.exec();","queryobject.sort('name');","queryobjectsort","queryobjectsort.exec();","reactiv","remov","remove()","removeddoc","resolv","result","result.","return","run","rxdb","rxdb,","rxdb.isrxquery(myobj);","rxdocument","rxqueri","rxquery'","rxquery.","sort","this,","time.","true","updat","update()","us","{","}","});"],"rx-attachment.html":["'cat.jpg'","'humans',","'image/jpeg'","'object',","(async)","(string)","(string|blob|buffer)",");",".","//","0,","=","=>","[];","ad","add","allattachments$","allattachments()","array","assign","attach","attachment'","attachment.","attachment.getdata();","attachment.getstringdata();","attachment.remove();","attachments,","attachments:","attributes/methods.","await","befor","better","binari","blob","blobbuff","buffer.","const","continu","data","data,","data.","db","digest","doc","document.","documents.","done.","each","emit","encrypt","encrypted:","ensur","exist.","files,","follow","get","getattachment()","getdata()","getstringdata()","here","higher","id","id,","id.","imag","length","limit","md5","mycollect","mydatabase.collection({","mydocument.allattachments$.subscribe(","mydocument.allattachments();","mydocument.getattachment('cat.jpg');","mydocument.putattachment({","myschema","name","name:","new","null","number","number.","object","observ","password","perform","pouchdb,","promis","properties:","putattachment()","quota","re","regular","remov","remove()","repres","resolv","return","rev","revis","rxattach","rxcollection.","rxdb","rxdb,","rxdocument","rxdocument.","schema","schema:","set","side","store","stream","string","string,","string.","sum","time","to.","true","true,","type","type:","us","version:","want","whatev","{","}","});","},","};"],"middleware.html":["'anyvalue';","'foobar'","'foobar',","'myfield',","()","(also","//","100));","=","=>","action","add","alreadi","another.","async","asynchron","asynchronous.","atom","avoid","await","befor","behavior","block","cach","call","case","certain","chang","clear","code.","collection.","complex","console.log(doc.myfield);","const","constructed.","continu","control","creat","custom","data","databas","database.","default","defin","delet","depend","differ","doc","doc.anyfield","document","document.","documents.","dure","emit","error('stop');","error.","event","execut","false);","field","field,","flexibl","follow","function","functions.","get:","getter/sett","happen","help","here","hook","hook,","hook?","hooks)","hooks:","ideas:","insert","instanc","interact","lastnam","level","lifecycl","list","logic","make","mean","middlewar","model","modifi","mongoose,","mongoose.","mycollection.findone().exec();","mycollection.postcreate(function(doc){","mycollection.postinsert(function(documentdata){","mycollection.postremove(function(doc){","mycollection.postsave(function(doc){","mycollection.preinsert(function(documentdata){","mycollection.preremove(function(doc){","mycollection.presave(function(doc){","nest","new","notice:","notif","object","object.defineproperty(doc,","on","oper","parallel","pass","post","postcreat","postinsert","postremov","postsav","pre","preinsert","preremov","presav","promise(r","promise.","receiv","remov","removed.","return","run","rxcollect","rxcollection.insert","rxdatabas","rxdb","rxdb,","rxdocument","rxdocument,","rxdocument.remov","rxdocument.sav","save","saved.","schema","seri","set","settimeout(res,","specif","specifi","stop","structur","support","sure","synchron","task","therefor","throw","trigger","true);","updat","us","usag","valid","valu","way","whenev","whole","written","{","});","},"],"orm.html":["'","'!!';","'aaah!!'","'aaah!!';","'cat.txt',","'heroes'","'heroes',","'i","'meow","'skeletor'","'text/plain'","+","//","=","add","attach","attachments:","await","behavior","call","capabl","collect","collection.","collection:","collections.","console.log(attachment.scream());","console.log(doc.scream());","console.log(doc.whoami());","console.log(heroes.scream());","console.log(heroes.whoami());","const","contain","continu","creat","data","data:","defin","doc","doc.putattachment({","document","function","function(){","functions,","here","hero","heroes.findone().exec();","heroes.insert({","id:","instanc","keyword","keyword:","kitty',","map","method","methods:","mongoose,","mydatabase.collection({","myschema,","name:","names.","new","object","orm","orm/drm","pass","relat","resolv","return","rxattachemnt","rxdb","rxdb,","rxdocument","schema:","scream:","skeletor!!'","specif","static","statics:","this.nam","this.name;","type:","us","whoami:","wide","wide.","{","}","});"],"population.html":["'alice'","'alice',","'array',","'bob',","'carol'","'carol',","'dave'","'human","'human'","'human',","'object',","'string'","'string',","(primari","//","//>","//[insert","0,","=","[","]","_","add","alway","anoth","array","array.","attribut","await","belong","bestfriend","bestfriend:","collect","collections.","come","console.dir(bestfriend);","console.dir(friends);","console.dir(mother);","const","continu","database.","describ","direct","doc","doc.bestfriend_;","doc.populate('bestfriend');","document","exactli","exampl","export","family:","field","fieldname.","foreign","found.","friend","friends:","getter","getter.","here","here]","human","human',","humanscollection.findone('alice').exec();","humanscollection.findone('bob').exec();","humanscollection.insert({","in.","items:","join","keyword","method","method.","mongoose.","mother","mother:","mycollect","mycollection.insert({","mydatabase.collection({","mydocument.family.mother_;","mydocument.friends_;","name:","nest","new","notic","null","on","path","popul","populate()","primary:","promis","properties:","ref","ref:","refer","referenc","refhuman","relat","resolv","return","rxcollect","rxdb","rxdb,","rxdocument","rxdocument)","rxdocument,","rxdocument[alice]","same","schema","schema:","sometim","specifi","still","string","take","therefor","title:","to.","true,","type:","underscor","underscore_","us","valu","values.","version:","via","want","work","{","}","});","},","};"],"data-migration.html":["'bi","'messages',","'sendercountry'","(or","(string)","(version:",");","*","*/",".migratepromise():",".then(respons","/**","//","0","0,","0.","02","1","12","12t23:03:05+00:00","1486940585","1:","2","2)","2017","2:","50,","=","=>","accomplish","add","alreadi","alway","amount","app","appear","assigned.","assur","asynchron","automat","automigr","automigrate:","await","awesom","bar.","better","call)","chang","client'","code","collect","collection,","collection.","combin","compar","console.dir(state),","console.error(error),","console.log('done')","const","continu","coordin","countri","created.","creation","data","data.","datamigr","date","date(olddoc.time).gettime();","dates.","decid","default,","defin","delet","deleted:","devic","distribut","doc","document","don't","done","done:","easier","emit","error","exist","false,","fetch('http://myserver.com/api/countrybycoordinates/'+coordinates+'/')","field","filter","finish","function","function(olddoc){","get","greater","hand'","handl","handled:","happen","here","hint","if(olddoc.tim","imagin","incom","increas","instead","leaderelect","load","long","look","lot","make","mani","match","means,","messag","messagecol","messagecol.migratepromise(10);","messages.","messageschemav1,","messeng","migrat","migrated.","migrated:","migratepromise;","migrationpromis","migrationstrategi","migrationstrategies:","mydatabase.collection({","name:","new","new,","newer","newest","null,","number","object","old","olddoc.coordinates;","olddoc.sendercountry=response;","olddoc.tim","olddoc;","older","on","open","paramet","percent:","percentag","problem","promis","properti","provid","remains:","remov","requir","resolv","resourc","respons","response.json();","return","run","rxdb","rxdb,","save","schema","schema'","schema:","schema?","schemas.","sender","server","show","start","state","strategi","string","succeed","success:","sure","tabs.","take","this,","this:","time,","timestamp","total:","transform","true","unix","upon","us","used:","user","user'","user,","users'","users.","version","version,","version.","want","wast","while,","{","}","});","},"],"leader-election.html":["'dies'.","'localstorage',","'mypassword',","'temperature',","'weatherdb',","*",".then(()","//","10","10);","1000","5","6*5=30","=","=>","access.","adapter:","algorithm","alway","api","await","becom","befor","between","browser","build,","case","charts,","check","client","closed,","closed.","code","collection.","conflict","connections.","console.log('long","const","continu","corner.","count","crown","current","data","data,","date().gettime()","db","db.collection({","db.temperature.insert({","db.waitforleadership()","degrees:","device,","display","easy,","elect","exact","exactli","exampl","fetch('https://example.com/api/temp/');","hand","heatmaps.","here","imagin","implement","inspect","king!');","lead","leader","leader,","leader.","leaderelect","live","locat","make","manag","mani","mark","matter","messag","minute.","moment","more","multiinstance:","myschema","name:","new","now","number","old","on","once.","open","out","over","password:","per","pleas","polling.","power","produce,","pull","read","reassign","redund","remot","resourc","right","run","rxdb","rxdb,","rxdb.create({","same","save","schema:","second","seconds.","see","send","sent","server","site","solut","solv","start","stay","sure","system","tab","tab.","tabs,","temp","temp,","temperatur","ten","them,","these","thing","this,","time","time:","top","traffic","tri","true","until","us","usag","vanillaj","variou","visitor","wait..","wast","way","websit","websocket","wire","you.","{","});","},","♛"],"replication.html":["'http://localhost:10102/db/',","(default)","(optional)","(remot",");","//","=","=>","[default=true]","active$","adapt","add","anoth","async","await","basic","call","cancel","cancel()","chang","change$","collect","complete$","complete.","completed.","completes.","connect","console.dir(active));","console.dir(change));","console.dir(completed));","console.dir(docdata));","console.dir(error));","const","continu","couchdb,","data.","database)","database.","db.","default=tru","depend","dies,","direct","direction:","docs$","document","dure","each","emit","enabl","error","error$","event","exampl","fals","featur","handler","here","here.","http","http'));","https://pouchdb.com/api.html#repl","instanc","instance,","intern","leader","live:","make","match","method","mycollection.find().where('age').gt(18)","mycollection.sync(","need","never","new","observ","occur","on","option","options:","over","performance,","plugin","pouch/couch","pouchdb","power","pull:","push:","queri","query:","recogn","reestablished.","remot","remote:","replic","replicated.","replication,","replication.","replicationst","replicationstate.active$.subscribe(act","replicationstate.cancel();","replicationstate.change$.subscribe(chang","replicationstate.complete$.subscribe(complet","replicationstate.docs$.subscribe(docdata","replicationstate.error$.subscribe(error","retry:","return","running.","rx.collection.sync()","rxcollect","rxcollection,","rxcollection.sync()","rxcollection.sync().","rxdb","rxdb,","rxdb.plugin(require('pouchdb","rxj","rxreplicationst","same","save","server","serverurl,","specifi","start","stream.","sure","sync","sync.","synchronis","time","true","true,","until","us","via","waitforleadership:","{","},"],"query-change-detection.html":["'');","'',","'rxdb';","+",".exec()'",".reduce((prev,","//","=","=>","again.","anyuser.loggedin","anyuser.save();","await","beta","big","calcul","call","case","collect","collection.","console.log","const","continu","cost.","creat","cur)","cur.username+","current","databas","default.","detect,","disabl","display","document.queryselector('body').innerhtml","documents,","documents.","done","driver,","enabl","enable()","enabled.","engine.","events.","everytim","exampl","false;","function","gain","here","huge","imagin","import","in.","io","it.","log","long","made","make","mani","memori","meteor","module.","multipl","new","notice:","now,","observ","off,","on","oplog","optim","optimis","over","page","perform","plu","point","prev","queri","queries,","queries.","query.","query.$.subscribe(us","querychangedetect","querychangedetector","querychangedetector.enable();","querychangedetector.enabledebugging();","re","realli","request","result","reus","run","rxchangeevent.","rxdb","rxdb,","same","show","similar","storag","subscrib","sure","take","then,","thousand","time","toplist","update/insert/remov","us","user","userscollection.find().where('loggedin').eq(true).sort('points');","veri","want","whole","without","work","zero","{","}","});"],"in-memory.html":["'npm","'pouchdb","(all","//","=","adapt","add","amount","anoth","attach","automat","await","befor","behav","both.","chang","collect","collection.","computer.","cons:","const","continu","creation","data","decrypt","disc","doc","document","encrypt","enough","equal","event","faster","field","fields.","fire","fit","heavi","here","import","important:","initi","inmemori","insid","instal","it'","load","longer","mean","memcol","memcol.find().exec();","memori","memory';","memory)","mycollect","mycollection.inmemory();","new","now","on","oper","optim","origin","over","parent","pouchadaptermemori","pouchdb","promis","pros:","queri","ram","replic","resolv","result","return","run","rxcollect","rxcollection().inmemory();","rxcollection,","rxdb,","rxdb.plugin(pouchadaptermemory);","same","save'","share","small","store","stream.","support","take","them,","two","u","updat","us","version","want","way","work","write"],"rx-local-document.html":["'bar'","'bar');","'bar';","'bar2');","'foobar',",");","*/","..","/*","//","=","=>","access","addit","alreadi","attach","await","behav","chang","class","collect","collection.","come","const","continu","creat","data","databas","document","documents.","exist","exists.","field","find","foo","foo:","found","getlocal()","handi","handl","here","id","id.","insertlocal()","it'","local","localdoc","localdoc.foo","localdoc.foo;","localdoc.get$('foo').subscribe(valu","localdoc.get('foo');","localdoc.remove();","localdoc.save();","localdoc.set('foo',","localdocu","match","metadata.","migrat","mycollection.getlocal('foobar');","mycollection.insertlocal(","mycollection.upsertlocal(","mydatabase.insertlocal(","new","next","normal","notice:","null","observ","overwrit","promis","proxi","pseudo","queri","remov","replic","resolv","return","rxcollect","rxdatabas","rxdb,","rxdocument.","rxlocaldocu","rxlocaldocument.","same","schema","schema,","set","special","store","throw","undefin","upsertlocal()","us","via","want","work","work!","work.","works!","{","}","});"],"custom-build.html":["'rxdb/plugins/adapt","'rxdb/plugins/ajv","'rxdb/plugins/attachments';","'rxdb/plugins/core';","'rxdb/plugins/encryption';","'rxdb/plugins/error","'rxdb/plugins/in","'rxdb/plugins/json","'rxdb/plugins/key","'rxdb/plugins/lead","'rxdb/plugins/loc","'rxdb/plugins/no","'rxdb/plugins/replication';","'rxdb/plugins/schema","'rxdb/plugins/update';","'rxdb/plugins/validate';","//","=","adapt","add","addit","advantag","ajv","altern","alway","anoth","attach","bandwidth","basic","batteri","befor","better","bigger","bit","build","build,","builds.","check","check'));","check';","checkadapt","cherri","choos","code","collect","collections.","compliant","compress","compress,","compression'));","compression';","const","continu","core","core,","correctli","creat","crypto","custom","data","databas","database.","databases.","default","default,","default.","dev","develop","disablekeycompress","disadvantag","document","documents'));","documents';","don't","done","dump","dump'));","dump';","elect","election'));","election';","enabl","enabled.","encrypt","ensur","error","es5","es6","faster.","full","function","functionality.","handl","hard","here","import","import/export","imported.","includ","input","insert","instead.","javascript,","js","json","jsonschema","key","keycompress","keycompressor","leader","leaderelect","leaderelection.","local","lot","make","mean","meant","memori","memory'));","memory';","messag","messages'));","messages';","mode.","modul","module,","module.","need","need.","new","normal","not.","noth","on","option","overwrit","part","password.","pick","plugin","plugin.","product","provid","realli","reduc","reli","replic","requir","require('rxdb/plugins/core');","required.","rxcollection.","rxdb","rxdb,","rxdb.","rxdb.plugin(require('rxdb/plugins/adapt","rxdb.plugin(require('rxdb/plugins/ajv","rxdb.plugin(require('rxdb/plugins/attachments'));","rxdb.plugin(require('rxdb/plugins/encryption'));","rxdb.plugin(require('rxdb/plugins/error","rxdb.plugin(require('rxdb/plugins/in","rxdb.plugin(require('rxdb/plugins/json","rxdb.plugin(require('rxdb/plugins/key","rxdb.plugin(require('rxdb/plugins/lead","rxdb.plugin(require('rxdb/plugins/loc","rxdb.plugin(require('rxdb/plugins/no","rxdb.plugin(require('rxdb/plugins/replication'));","rxdb.plugin(require('rxdb/plugins/schema","rxdb.plugin(require('rxdb/plugins/update'));","rxdb.plugin(require('rxdb/plugins/validate'));","rxdb.plugin(rxdbadaptercheckmodule);","rxdb.plugin(rxdbajvvalidatemodule);","rxdb.plugin(rxdbattachmentsmodule);","rxdb.plugin(rxdbencryptionmodule);","rxdb.plugin(rxdbinmemorymodule);","rxdb.plugin(rxdbjsondumpmodule);","rxdb.plugin(rxdbkeycompressionmodule);","rxdb.plugin(rxdbleaderelectionmodule);","rxdb.plugin(rxdblocaldocumentsmodule);","rxdb.plugin(rxdbnovalidatemodule);","rxdb.plugin(rxdbreplicationmodule);","rxdb.plugin(rxdbschemacheckmodule);","rxdb.plugin(rxdbupdatemodule);","rxdb.plugin(rxdbvalidatemodule);","rxdbadaptercheckmodul","rxdbajvvalidatemodul","rxdbattachmentsmodul","rxdbencryptionmodul","rxdberrormessagesmodul","rxdbinmemorymodul","rxdbjsondumpmodul","rxdbkeycompressionmodul","rxdbleaderelectionmodul","rxdblocaldocumentsmodul","rxdbnovalidatemodul","rxdbreplicationmodul","rxdbschemacheckmodul","rxdbupdatemodul","rxdbvalidatemodul","rxdocument.","rxdocument.upd","rxquery.update.","save","schema","schemacheck","set","size,","size.","standart","start","support","sure","thing","this,","this:","throw","thrown.","true","updat","us","valid","valid.","validate'));","validate';","validation.","want","work"],"plugins.html":["!==","&&","'bar'","'foo'.","'mycollection.hello()'","'string'","'world';","()=>'bar'","(password","(proto)","*","*/","/**","//","=","=>","@link","@param","ad","add","addit","afterward","alway","anyth","avail","basic","builds/src/plugin.j","call","call.","class","classes,","code","collect","collection.options.foo();","const","contain","continu","correspond","creat","data","don't","each","exist","extend","fill","find","foo:","function","function(){","function(password)","get","here","here.","hook","hooks.","https://github.com/pubkey/rxdb/blob/cutsom","insid","intern","it.","javascript","jump","keynam","know","list","list:","manipul","manipulate.","method","method,","modifi","mydatabase.collection({","myplugin","myschema,","name:","new","object","object.","option","options:","overwrit","overwritable:","overwritten","paramet","parameter,","pass","password","password.length","plugin","plugin.","plugins:","pouchdb","properti","proto.hello","prototyp","prototypes:","requir","return","rxcollect","rxcollection:","rxdatabas","rxdb","rxdb'","rxdb,","rxdb:","schema:","see","set","signal","simple.","sometim","static","static.","these","time","true","true,","true.","typeof","us","validatepassword:","valu","veri","want","{","{object}","||","}","})","},","};"],"contribute.html":["&&","(anyth","7","ad","add","ask","befor","bug,","bugfix","build","cd","change.","changes,","check","clone","commit","community.","console.","contribut","contributing!","contribution,","creat","depend","dev","develop","developing,","device,","discuss","dist","doc","docs:instal","docs:serv","document","don't","ensur","everyth","expect","expected.","featur","feature,","file","file.","flow","folder)","folder.","following:","for,","get","git","gitter.","grate","help","higher","http://localhost:4000/","https://github.com/pubkey/rxdb.git","instal","integr","issu","it.","leav","locally,","made","make","manual","merg","modifi","need","nodej","non","npm","open","pr","pull","read","repositori","reproduc","request,","requir","run","rxdb","slow","sourc","src","start","sure","test","test/unit","test:nod","tests,","thank","time","time.","to,","togeth","trivial","unit","version","want","wast","work","work."]},"length":20},"tokenStore":{"root":{"0":{"2":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.014705882352941176},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010380622837370242},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"1":{"0":{"0":{"0":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},")":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}},"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"2":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"t":{"2":{"3":{"docs":{},":":{"0":{"3":{"docs":{},":":{"0":{"5":{"docs":{},"+":{"0":{"0":{"docs":{},":":{"0":{"0":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"4":{"8":{"6":{"9":{"4":{"0":{"5":{"8":{"5":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"8":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"9":{"0":{"0":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"docs":{}},"docs":{}},"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}},"2":{"0":{"1":{"7":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},"docs":{}},"5":{"0":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"docs":{}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}},"4":{"0":{"9":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},"docs":{}},"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"5":{"0":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"6":{"docs":{},"*":{"5":{"docs":{},"=":{"3":{"0":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"docs":{}},"docs":{}}},"docs":{}}},"7":{"7":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"9":{"docs":{},"]":{"docs":{},"$":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"*":{"docs":{},"$":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"_":{"docs":{},"]":{"docs":{},"*":{"docs":{},"]":{"docs":{},"?":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"docs":{},">":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}},"c":{"docs":{},"l":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"c":{"docs":{},"k":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"n":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"d":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"e":{"docs":{},"v":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"s":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"t":{"docs":{},"s":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"i":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"o":{"docs":{},"o":{"docs":{},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}}}}},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"t":{"docs":{},"e":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"s":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}},"e":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":10.012422360248447}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"!":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"o":{"docs":{},"n":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}},"o":{"docs":{},"k":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}}}}}}}}}},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"(":{"docs":{},"'":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}}}}}}}}}}}},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"m":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"o":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"o":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01694915254237288},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.05063291139240506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.046218487394957986},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.041474654377880185},"population.html":{"ref":"population.html","tf":0.03460207612456748},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.03686635944700461},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"n":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.036016949152542374},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006920415224913495},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.04054054054054054},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"o":{"docs":{},"n":{"2":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},"s":{"docs":{},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"r":{"docs":{},"d":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"e":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"n":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"r":{"docs":{},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"s":{"docs":{},"t":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"c":{"docs":{},"u":{"docs":{},"l":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}}},"s":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"c":{"docs":{},"h":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"p":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}}}}},"p":{"docs":{},"u":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}},")":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},".":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"+":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"custom-build.html":{"ref":"custom-build.html","tf":5.006550218340611}}}}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"d":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.012711864406779662},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.03361344537815126},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.041474654377880185},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-database.html":{"ref":"rx-database.html","tf":0.031026252983293555},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"s":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":10.00257731958763}}}}}}},"e":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"(":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"=":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"i":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"p":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"i":{"docs":{},"c":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"i":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"y":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"t":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"`":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"b":{"1":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"2":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"i":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}},"[":{"docs":{},"'":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},"]":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"population.html":{"ref":"population.html","tf":0.010380622837370242},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.024844720496894408}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.02754237288135593},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"rx-query.html":{"ref":"rx-query.html","tf":0.0379746835443038},"middleware.html":{"ref":"middleware.html","tf":0.018140589569160998},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.010380622837370242},"data-migration.html":{"ref":"data-migration.html","tf":0.01804123711340206},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06912442396313365},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"o":{"docs":{},"d":{"docs":{},"y":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"n":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}}}}}},"s":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},":":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"n":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"'":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"r":{"docs":{},"e":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"i":{"docs":{},"s":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"c":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"u":{"docs":{},"s":{"docs":{},"s":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"l":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}},"y":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"r":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"l":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"s":{"docs":{},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.03361344537815126},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006920415224913495},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"t":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}},"s":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},"(":{"docs":{},")":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},")":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},")":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.034013605442176874}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},")":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}}}}}},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},":":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"s":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"o":{"docs":{},"w":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"e":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"(":{"docs":{},"'":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"m":{"docs":{},"y":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"b":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"/":{"docs":{},"'":{"docs":{},"+":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"+":{"docs":{},"'":{"docs":{},"/":{"docs":{},"'":{"docs":{},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"/":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"/":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},".":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},"o":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788}},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"v":{"docs":{},"i":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"t":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"l":{"docs":{},"p":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"i":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}}}},"r":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"n":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"o":{"docs":{},"o":{"docs":{},"k":{"docs":{"middleware.html":{"ref":"middleware.html","tf":5.054421768707483},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"?":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"s":{"docs":{},")":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}},"'":{"docs":{},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}}}}}}}},"b":{"docs":{},"o":{"docs":{},"b":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"population.html":{"ref":"population.html","tf":0.01384083044982699}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},".":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"#":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"p":{"docs":{},"u":{"docs":{},"b":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"/":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"/":{"docs":{},"c":{"docs":{},"u":{"docs":{},"t":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},":":{"4":{"0":{"0":{"0":{"docs":{},"/":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":10}}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"r":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"r":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"c":{"docs":{},"l":{"docs":{},"u":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"o":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":10.030674846625766},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}},"n":{"docs":{},"c":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}},"e":{"docs":{},"d":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"s":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":10.006756756756756}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.07975460122699386},"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.07423580786026202}},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"/":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"r":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}},"a":{"docs":{},"g":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"d":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"a":{"docs":{},"s":{"docs":{},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}},"g":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}}}}}}}}}}},"s":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"s":{"docs":{},"u":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"t":{"docs":{},"'":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"f":{"docs":{},"(":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"o":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"j":{"docs":{},"a":{"docs":{},"v":{"docs":{},"a":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.027210884353741496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"s":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"e":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.017467248908296942},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"s":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006920415224913495}},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"x":{"docs":{},"t":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"p":{"docs":{},"m":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"contribute.html":{"ref":"contribute.html","tf":0.043478260869565216}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.027649769585253458},"population.html":{"ref":"population.html","tf":0.03460207612456748},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"s":{"docs":{},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"j":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"i":{"docs":{},"c":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"f":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"n":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}}},"l":{"docs":{},"l":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"r":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}},"l":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"=":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.04048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}}},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"m":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"i":{"docs":{},"s":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"c":{"docs":{},"e":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"/":{"docs":{},"d":{"docs":{},"r":{"docs":{},"m":{"docs":{"orm.html":{"ref":"orm.html","tf":10}}}}}}},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"in-memory.html":{"ref":"in-memory.html","tf":0.033783783783783786}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},"w":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.03211009174311927}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}},"c":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"r":{"docs":{},"e":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"i":{"docs":{},"v":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"e":{"docs":{},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}}}}},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"a":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.006920415224913495}}}},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"i":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":10.032710280373832},"in-memory.html":{"ref":"in-memory.html","tf":0.033783783783783786},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"s":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}},"e":{"docs":{},"s":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.039301310043668124},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}},"d":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"i":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.03164556962025317},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},".":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.02531645569620253},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.029411764705882353},"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"r":{"docs":{},"y":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"g":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"f":{"docs":{"population.html":{"ref":"population.html","tf":0.010380622837370242}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.010380622837370242}}},"e":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.01384083044982699}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"h":{"docs":{},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"g":{"docs":{},"n":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}},"v":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"i":{"docs":{},"s":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{"install.html":{"ref":"install.html","tf":0.03680981595092025},"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.019650655021834062},"plugins.html":{"ref":"plugins.html","tf":0.027522935779816515},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"'":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"o":{"docs":{},"c":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"n":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"v":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"j":{"docs":{},"v":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":10.011933174224344},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":10.012704174228675},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"population.html":{"ref":"population.html","tf":0.01384083044982699}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},")":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},"[":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}}}}}}}}}}}}},"j":{"docs":{"install.html":{"ref":"install.html","tf":0.03067484662576687},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"s":{"docs":{},"'":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":10.002100840336135},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":10.002118644067796},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":10.031645569620252}}},"y":{"docs":{},"'":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519}}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":10.012605042016807}},"e":{"docs":{},"m":{"docs":{},"n":{"docs":{},"t":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.06832298136645963}},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"m":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"u":{"docs":{},"r":{"docs":{},"l":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.02947845804988662}}}},"m":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"m":{"docs":{},"e":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}}}}}}}}}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}},")":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}},"z":{"docs":{},"e":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"p":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"e":{"docs":{},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}},"t":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"t":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"i":{"docs":{},"c":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"s":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"n":{"docs":{},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"y":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"o":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"d":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"'":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"population.html":{"ref":"population.html","tf":0.006920415224913495},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"u":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}}}}},"p":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"r":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"m":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"s":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"w":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"i":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"o":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}},"r":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"v":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"c":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},"i":{"docs":{},"f":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"a":{"docs":{},"w":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"replication.html":{"ref":"replication.html","tf":0.04205607476635514}},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0273109243697479},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.008733624454148471}},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815}},"o":{"docs":{},"r":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006920415224913495},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"?":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}},"k":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"r":{"docs":{},"c":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"\"":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"+":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"@":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"p":{"docs":{},"u":{"docs":{},"b":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"/":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"#":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"\"":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"\"":{"docs":{},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"y":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"k":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.02100840336134454}}}}}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"b":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"r":{"2":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}},"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.010380622837370242}}}}}},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"o":{"docs":{},"c":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"n":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"/":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"/":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"/":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206}}}}}},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"orm.html":{"ref":"orm.html","tf":0.02304147465437788}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"s":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.01384083044982699}}}}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},":":{"1":{"0":{"1":{"0":{"2":{"docs":{},"/":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"'":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},"]":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"w":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}}}}}}}}},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"'":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"(":{"docs":{},")":{"docs":{},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"e":{"docs":{},"b":{"docs":{},"s":{"docs":{},"q":{"docs":{},"l":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{},"'":{"docs":{},";":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"i":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"/":{"docs":{},"j":{"docs":{},"p":{"docs":{},"e":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010380622837370242}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.012605042016806723},"population.html":{"ref":"population.html","tf":0.01730103806228374},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"}":{"docs":{},"}":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"b":{"docs":{},"a":{"docs":{},"r":{"2":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}},"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.006920415224913495}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.010380622837370242}}}}}}}},"n":{"docs":{},"y":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}},"a":{"docs":{},"a":{"docs":{},"h":{"docs":{},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"'":{"docs":{},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"p":{"docs":{},"m":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},".":{"docs":{},"j":{"docs":{},"p":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"t":{"docs":{},"x":{"docs":{},"t":{"docs":{},"'":{"docs":{},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}},"'":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}},"/":{"docs":{},"/":{"docs":{"install.html":{"ref":"install.html","tf":0.05521472392638037},"rx-database.html":{"ref":"rx-database.html","tf":0.028639618138424822},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.036016949152542374},"rx-document.html":{"ref":"rx-document.html","tf":0.05263157894736842},"rx-query.html":{"ref":"rx-query.html","tf":0.0379746835443038},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.029411764705882353},"middleware.html":{"ref":"middleware.html","tf":0.049886621315192746},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.010380622837370242},"data-migration.html":{"ref":"data-migration.html","tf":0.03865979381443299},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.04672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06912442396313365},"custom-build.html":{"ref":"custom-build.html","tf":0.06986899563318777},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},">":{"docs":{"population.html":{"ref":"population.html","tf":0.01384083044982699}}},"[":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}},"*":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"*":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}}}},"=":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.0211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.043557168784029036},"rx-query.html":{"ref":"rx-query.html","tf":0.05063291139240506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.05042016806722689},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.041474654377880185},"population.html":{"ref":"population.html","tf":0.03460207612456748},"data-migration.html":{"ref":"data-migration.html","tf":0.01804123711340206},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.041474654377880185},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},">":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.019067796610169493},"rx-document.html":{"ref":"rx-document.html","tf":0.014519056261343012},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"=":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"a":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.017467248908296942},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"i":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.02386634844868735},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206}}},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"$":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"i":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"g":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"m":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"population.html":{"ref":"population.html","tf":0.006920415224913495},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"w":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}},"g":{"docs":{},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"v":{"docs":{},"e":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"c":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"s":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"i":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}},"k":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"s":{"docs":{},"/":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.10504201680672269},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},":":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.016706443914081145},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.012711864406779662},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"rx-query.html":{"ref":"rx-query.html","tf":0.02531645569620253},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.025210084033613446},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.04608294930875576},"population.html":{"ref":"population.html","tf":0.04844290657439446},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.03225806451612903}}}}},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"b":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"b":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}}}},"s":{"docs":{},"i":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},"r":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"n":{"docs":{},"d":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"e":{"docs":{},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"t":{"docs":{},"w":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"a":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"h":{"docs":{},"a":{"docs":{},"v":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"i":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.01730103806228374}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},"s":{"docs":{},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":5.010917030567685},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"s":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"/":{"docs":{},"s":{"docs":{},"r":{"docs":{},"c":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},".":{"docs":{},"j":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"g":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}}},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"y":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"t":{"docs":{},"h":{"docs":{},".":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"b":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"c":{"docs":{},"k":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"e":{"docs":{},"s":{"5":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"custom-build.html":{"ref":"custom-build.html","tf":0.034934497816593885}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"6":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"custom-build.html":{"ref":"custom-build.html","tf":0.034934497816593885}}},"8":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}},"docs":{},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}}},"s":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"y":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.02336448598130841}}}}},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"d":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},":":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}},"v":{"docs":{},"i":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}}}},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"(":{"docs":{},"'":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"r":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}},"i":{"docs":{},"m":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"population.html":{"ref":"population.html","tf":0.006920415224913495},"leader-election.html":{"ref":"leader-election.html","tf":0.024291497975708502},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}},"c":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{},"i":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}}},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"e":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"u":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"s":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}}}}},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"e":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"/":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498}}}},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"s":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}}}}}}},"a":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.024291497975708502},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":10},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"v":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}}},"i":{"docs":{},"b":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"f":{"docs":{},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"s":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"v":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06451612903225806},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.02304147465437788}},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"$":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":10}}}}}},"l":{"docs":{},"y":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"o":{"docs":{},"k":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517}},"i":{"docs":{},"c":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"a":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"n":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}},"e":{"docs":{},"r":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"s":{"docs":{},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"m":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"}":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.06756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},"y":{"docs":{},"'":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},")":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},"s":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"e":{"docs":{},"o":{"docs":{},"r":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"v":{"1":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}},"docs":{}}}}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"r":{"docs":{},"g":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"k":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.024844720496894408}}}},"p":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}},"x":{"docs":{},"i":{"docs":{},"m":{"docs":{},"u":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"n":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"a":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"r":{"docs":{},"k":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"d":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}},"n":{"docs":{},"d":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"d":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":5.00907029478458}}}}}}}}}},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.03056768558951965}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"y":{"docs":{},"j":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"e":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"n":{"docs":{},"g":{"docs":{},"o":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.006920415224913495},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{},"p":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}}}}}}}}}}}}}}}}}}}},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"t":{"docs":{},"(":{"1":{"8":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}},"docs":{}},"docs":{}}}},"l":{"docs":{},"t":{"docs":{},"(":{"1":{"8":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"{":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}}}},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"0":{"0":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"docs":{}},"docs":{}},"docs":{}},"docs":{},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006920415224913495},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},".":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"$":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136}},"e":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},".":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"$":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},".":{"docs":{},"j":{"docs":{},"p":{"docs":{},"g":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136}}}}}}}},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"d":{"5":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"docs":{}}},"p":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},".":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.02947845804988662}}}}}}},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"s":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},"g":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"e":{"docs":{},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}}},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"a":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"k":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"e":{"docs":{},"c":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"o":{"docs":{},"l":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}},"l":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"s":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":0.018691588785046728},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":10.017301038062284}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495}}}}}}}}}},"s":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"r":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"v":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623}}}}}},"o":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}},"e":{"docs":{},"(":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.01384083044982699}}}}}},"y":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.045871559633027525}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"x":{"docs":{},"i":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"s":{"docs":{},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"s":{"docs":{},"h":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"u":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":10.03211009174312}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}},"s":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"u":{"docs":{},"d":{"docs":{},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"p":{"docs":{},"i":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}}}}}}}},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"c":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"u":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}}}}}},"v":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"a":{"docs":{},"s":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"b":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"leader-election.html":{"ref":"leader-election.html","tf":0.032388663967611336}},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"k":{"docs":{},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.062111801242236024}},"s":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"/":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},":":{"docs":{},"n":{"docs":{},"o":{"docs":{},"d":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"a":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"m":{"docs":{},"p":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}}}}}}}},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"h":{"docs":{},"i":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"e":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"n":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"m":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"s":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"n":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"n":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"w":{"docs":{},"o":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"o":{"docs":{},"p":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.02100840336134454}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0273109243697479},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.03460207612456748}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"o":{"docs":{},"f":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"u":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"s":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.02386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01680672268907563},"rx-collection.html":{"ref":"rx-collection.html","tf":0.019067796610169493},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.021834061135371178},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.037037037037037035}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"s":{"docs":{},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"n":{"docs":{},"i":{"docs":{},"q":{"docs":{},"u":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"e":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}},"x":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"t":{"docs":{},"i":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"e":{"docs":{},"_":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"/":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"/":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259}},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748},"custom-build.html":{"ref":"custom-build.html","tf":0.028384279475982533}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"u":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006920415224913495},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"j":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"data-migration.html":{"ref":"data-migration.html","tf":0.023195876288659795},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010380622837370242}}},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"i":{"docs":{},"a":{"docs":{"population.html":{"ref":"population.html","tf":0.006920415224913495},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"i":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}},".":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"y":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}},"s":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}}}}},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"i":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"d":{"docs":{},"e":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}}},"r":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.006920415224913495},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"!":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"s":{"docs":{},"!":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"r":{"docs":{},"y":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"i":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}},"e":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"a":{"docs":{},"p":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"e":{"docs":{},"b":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}}}}}}}}},"{":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.06092436974789916},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.05190311418685121},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304},"plugins.html":{"ref":"plugins.html","tf":0.027522935779816515}},"$":{"docs":{},"e":{"docs":{},"q":{"docs":{},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"}":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"}":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-schema.html":{"ref":"rx-schema.html","tf":0.014705882352941176},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.04608294930875576},"population.html":{"ref":"population.html","tf":0.03806228373702422},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.014519056261343012},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.03225806451612903},"population.html":{"ref":"population.html","tf":0.02422145328719723},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.029411764705882353},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.047619047619047616},"population.html":{"ref":"population.html","tf":0.010380622837370242},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},";":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034602076124567475},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"$":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"replication.html":{"ref":"replication.html","tf":0.018691588785046728}}},"=":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"$":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"|":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"|":{"docs":{},"b":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"i":{"docs":{},"a":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"n":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},")":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"=":{"docs":{},">":{"docs":{},"'":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}}}}}},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},")":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"*":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.03211009174311927}},"/":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}},"u":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}}}}},"'":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"e":{"docs":{},"(":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"v":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"[":{"1":{"docs":{},",":{"2":{"docs":{},",":{"3":{"docs":{},",":{"4":{"docs":{},"]":{"docs":{},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"(":{"docs":{},"n":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}},"\"":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},"]":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"]":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"=":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"]":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}},"^":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"`":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"`":{"docs":{},"`":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034602076124567475}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"e":{"docs":{},"p":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"i":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"'":{"docs":{},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}},"n":{"docs":{},"g":{"docs":{},"!":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}},"z":{"0":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"docs":{},"]":{"docs":{},"[":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"a":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615}}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-query.html":{"ref":"rx-query.html","tf":0.03164556962025317},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.030864197530864196},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"y":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"u":{"docs":{},"s":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}}}}}}}}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":10.030864197530864}},"o":{"docs":{},"r":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},".":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"d":{"docs":{},"e":{"docs":{},"b":{"docs":{},"u":{"docs":{},"g":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"!":{"docs":{},"[":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"f":{"docs":{},"]":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"/":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"f":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"=":{"docs":{},"=":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}},"+":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},"_":{"docs":{"population.html":{"ref":"population.html","tf":0.0034602076124567475}}},"y":{"docs":{},"o":{"docs":{},"u":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"♛":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"&":{"docs":{},"&":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"@":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"k":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"|":{"docs":{},"|":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"length":3004},"corpusTokens":["!==","![synced.gif](files/synced.gif)","\"array\",","\"birthyear\":","\"color\":","\"damage\":","\"dependencies\":","\"describ","\"description\":","\"encrypted\":","\"final\":","\"git+https://git@github.com/pubkey/rxdb.git#commithash\"","\"healthpoints\":","\"hero","\"item\":","\"max\":","\"maxitems\":","\"min\":","\"name\":","\"number\"","\"number\",","\"object\",","\"primary\":","\"properties\":","\"required\":","\"rxdb\":","\"secret\":","\"skills\":","\"string\"","\"string\",","\"title\":","\"type\":","\"uniqueitems\":","\"version\":","$","$inc:","$set:","&&","'","'!!';","'');","'',","'aaah!!'","'aaah!!';","'alice'","'alice',","'anyvalue';","'array',","'babel","'bar'","'bar');","'bar';","'bar2'","'bar2');","'barfoo';","'bi","'bob'","'bob',","'carol'","'carol',","'cat.jpg'","'cat.txt',","'dave'","'dies'.","'foo',","'foo'.","'foo'}})","'foobar'","'foobar');","'foobar',","'foobar';","'foobar2'","'foobar2');","'foobar2';","'heroes'","'heroes',","'heroesdb',","'http://localhost:10102/db/',","'human","'human'","'human',","'humans',","'i","'image/jpeg'","'integer',","'kelso'","'kelso';","'lastname']","'localstorage');","'localstorage',","'memdown';","'meow","'messages',","'mycollection.hello()'","'mydatabase',","'myfield',","'mypassword',","'name'","'npm","'object',","'pouchdb","'rxdb';","'rxdb/plugins/adapt","'rxdb/plugins/ajv","'rxdb/plugins/attachments';","'rxdb/plugins/core';","'rxdb/plugins/encryption';","'rxdb/plugins/error","'rxdb/plugins/in","'rxdb/plugins/json","'rxdb/plugins/key","'rxdb/plugins/lead","'rxdb/plugins/loc","'rxdb/plugins/no","'rxdb/plugins/replication';","'rxdb/plugins/schema","'rxdb/plugins/update';","'rxdb/plugins/validate';","'rxjs';","'rxjs/add/operator/filter';","'rxjs/add/operator/first';","'rxjs/add/operator/map';","'rxjs/add/operator/mergemap';","'rxjs/operators/filter';","'rxjs/subject';","'sendercountry'","'skeletor'","'string'","'string',","'temperature',","'text/plain'","'weatherdb',","'websql',","'world';","($)","()","()=>'bar'","(all","(also","(anyth","(async)","(default)","(optional)","(optional=false)","(optional=true)","(or","(password","(primari","(proto)","(remot","(string)","(string|blob|buffer)","(synced$","(version:","(via",");","*","*/","*/).then(()","+",".","..",".collection()",".create()",".exec()'",".exec().then(doc",".exec().then(docu",".find()",".insert()",".migratepromise():",".reduce((prev,",".save()",".subscribe(changeev",".subscribe(newnam",".then(()",".then(collect",".then(json",".then(respons",".upsert()",".where()","/*","/**","//","//>","//[insert","0","0,","0.","02","1","10","10);","100","100));","1000","12","12t23:03:05+00:00","1486940585","18","1900,","1:","2","2)","20","2017","2050","2:","4","409","5","5,","50,","6*5=30","7","77;","9]$","9]*$.","9_]*]?[a","=","==","=>",">","@link","@param","[","[\"color\"]","['firstname',","[1,2,3,4].foreach(nr","[];","[default=true]","]","^[a","_","```","```html","`queri","abov","access","access.","accident","accomplish","action","active$","actual","ad","adapt","adapter,","adapter:","adapters.","add","addit","additionalproperti","advantag","advantages:","affect","afterward","afterwards.","ag","again.","age:","ajv","algorithm","alic","allattachments$","allattachments()","allow","alreadi","altern","alway","amount","angular","anoth","another.","anyth","anyuser.loggedin","anyuser.save();","anyway","api","app","app,","app.","appear","argument,","array","array.","ask","assign","assigned.","assum","assur","async","asynchron","asynchronous.","at.","atom","atomicupdate()","atomicupdate:","atomicupsert()","attach","attachment'","attachment.","attachment.getdata();","attachment.getstringdata();","attachment.remove();","attachments,","attachments:","attribut","attribute.","attributes/methods.","automat","automigr","automigrate:","avail","avoid","await","awesom","b","babel","bandwidth","bar.","base","basic","batteri","becom","befor","before.","behav","behavior","belong","bestfriend","bestfriend:","beta","better","between","big","bigger","binari","birthyear","bit","blob","blobbuff","block","boolean","both.","browser","browsers,","browsers.","buffer.","bug,","bugfix","build","build,","builds.","builds/src/plugin.j","cach","calcul","call","call)","call.","cancel","cancel()","capabl","case","cd","certain","chain","chang","change$","change.","changed.","changeev","changes,","changes.","characters.","charts,","check","check'));","check';","checkadapt","checkadapter()","cherri","choos","class","classes,","cleanup","clear","click","client","client'","clone","closed,","closed.","code","code.","collect","collection'","collection,","collection.","collection.options.foo();","collection2","collection2);","collection:","collections.","color","combin","come","commit","commit.","commithash","common","community.","compar","complete$","complete.","completed.","completes.","complex","compliant","compound","compoundindex","compress","compress,","compression'));","compression',","compression';","compression,","computer.","conflict","conform","connect","connections.","cons:","console.","console.dir(active));","console.dir(bestfriend);","console.dir(change));","console.dir(changeevent));","console.dir(collection));","console.dir(completed));","console.dir(currentname);","console.dir(currentnestedvalue);","console.dir(doc));","console.dir(docdata));","console.dir(documents));","console.dir(error));","console.dir(friends);","console.dir(isname);","console.dir(json));","console.dir(mother);","console.dir(mydatabase.heroes.name);","console.dir(mydocument.age);","console.dir(ok);","console.dir(results);","console.dir(state),","console.error(error),","console.log","console.log('done')","console.log('done'));","console.log('long","console.log(attachment.scream());","console.log(collect","console.log(doc.myfield);","console.log(doc.scream());","console.log(doc.whoami());","console.log(heroes.scream());","console.log(heroes.whoami());","console.log(laststate);","console.log(mydocument.deleted);","console.log(mydocument.firstname);","console.log(mydocument.get('firstname'));","console.log(mydocument.synced);","const","constructed.","contain","continu","contribut","contributing!","contribution,","control","coordin","cordova","core","core,","corner.","correctli","correspond","cost.","couchdb","couchdb,","count","countri","cpu.","creat","created.","creation","crown","crypto","cur)","cur.username+","current","currentnam","currentname;","currentnestedvalu","currentnestedvalue;","custom","damag","data","data,","data.","data:","databas","database)","database,","database.","database:","databases.","datamigr","date","date().gettime()","date(olddoc.time).gettime();","dates.","db","db.","db.collection({","db.heroes;","db.temperature.insert({","db.waitforleadership()","db1","db2","db['heroes']","decid","decrypt","default","default,","default.","default:","default=tru","defin","definit","definition.","degrees:","delet","deleted$","deleted$.","deleted:","depend","describ","destroy","destroy()","destroyed.","detect,","detection`,","dev","develop","developing,","devic","device,","dies,","differ","digest","direct","direction:","directli","directly.","disabl","disablekeycompress","disablekeycompression:","disadvantag","disc","discuss","display","dist","distribut","doc","doc.ag","doc.anyfield","doc.bestfriend_;","doc.populate('bestfriend');","doc.putattachment({","docdata","docs$","docs:instal","docs:serv","document","document,","document.","document.queryselector('body').innerhtml","documents'));","documents';","documents,","documents.","does,","dollarsign","don't","done","done.","done:","driver,","dump","dump'));","dump';","dump()","dure","each","easier","easily.","easy,","edit","elect","election'));","election';","electron","emit","emptydatabase.importdump(json)","enabl","enable()","enabled.","encrypt","encrypted,","encrypted.","encrypted:","engine.","enough","ensur","environment.","equal","error","error$","error('stop');","error.","error:","errors,","es5","es5.","es6","es8","especi","event","events.","everyth","everytim","exact","exactli","exampl","example,","example:","exec","execut","exist","exist.","exists.","expect","expected.","explicitli","export","extend","fals","false),","false);","false,","false.","false;","family:","faster","faster.","featur","feature,","fetch('http://myserver.com/api/countrybycoordinates/'+coordinates+'/')","fetch('https://example.com/api/temp/');","field","field,","field.","fieldnam","fieldname.","fieldnames,","fields.","file","file.","file:","files,","fill","filter","final","final,","final:","find","find()","findone()","finish","finished.","fire","first","firstnam","firstname:","fistname:","fit","flexibl","flow","folder","folder)","folder.","follow","following:","foo","foo:","foobar","for,","foreign","form","found","found.","free","friend","friends:","full","function","function(){","function(olddoc){","function(password)","function.","functionality.","functions,","functions.","gain","generated.","get","get$","get$()","get()","get:","getattachment()","getdata()","getlocal()","getstringdata()","getter","getter.","getter/sett","git","gitter.","given","gone","grate","greater","hand","hand'","handi","handl","handled.","handled:","handler","happen","hard","hash","healthpoint","heatmaps.","heavi","help","here","here.","here]","hero","hero\",","hero.","heroes.findone().exec();","heroes.insert({","higher","hint","hook","hook,","hook?","hooks)","hooks.","hooks:","http","http'));","http://localhost:4000/","https://github.com/pubkey/rxdb.git","https://github.com/pubkey/rxdb/blob/cutsom","https://pouchdb.com/api.html#repl","huge","human","human',","humanscollection.findone('alice').exec();","humanscollection.findone('bob').exec();","humanscollection.insert({","id","id,","id.","id:","ideas:","ident","identifi","idl","idle.","if(olddoc.tim","ignoredupl","ignoreduplicate:","imag","imagin","immut","immutable.","implement","import","import/export","important:","importdump()","imported.","improv","in.","includ","incom","increas","index","index,","index:","indexed,","indexes,","initi","inmemori","input","insert","insert()","insertlocal()","insid","inspect","instal","instanc","instance,","instance.","instantli","instead","instead.","integ","integr","intent","interact","intern","introduct","invalid","io","isnam","isname;","isrxcollect","isrxdatabas","isrxdocu","isrxqueri","issu","it'","it,","it.","items:","javascript","javascript,","javascript.","join","js","json","jsonschema","jump","keep","key","keycompress","keycompressor","keynam","keyword","keyword:","king!');","kitty',","know","known","last","lastnam","lastname:","lastpromis","lastpromise;","laststat","later","later.","latest","lead","leader","leader,","leader.","leaderelect","leaderelection.","learn","leav","length","less","lettabl","level","leveldb","leveldb'));","lib,","life","lifecycl","limit","list","list:","live","live:","load","local","localdoc","localdoc.foo","localdoc.foo;","localdoc.get$('foo').subscribe(valu","localdoc.get('foo');","localdoc.remove();","localdoc.save();","localdoc.set('foo',","localdocu","locally,","localstorage'));","locat","log","logic","long","longer","look","looks.","lot","made","main","make","manag","mani","manipul","manipulate.","manual","map","mark","match","matter","maximum","md5","mean","means,","meant","memcol","memcol.find().exec();","memdown","memdown});","memori","memory'));","memory';","memory)","merg","messag","messagecol","messagecol.migratepromise(10);","messages'));","messages';","messages.","messageschemav1,","messeng","metadata.","meteor","method","method,","method.","methods:","middlewar","migrat","migrated.","migrated:","migratepromise;","migrationpromis","migrationstrategi","migrationstrategies:","mind","minute.","mistake,","mode.","model","modifi","modifyjs.","modul","module,","module.","moment","mongo","mongoose,","mongoose.","more","mother","mother:","ms","multiinst","multiinstance:","multipl","mycollect","mycollection.$.subscribe(changeev","mycollection.atomicupsert(docdata);","mycollection.customcleanupfunction();","mycollection.dump()","mycollection.dump(true)","mycollection.find().exec()","mycollection.find().where('age').gt(18)","mycollection.find().where('age').gt(18);","mycollection.find().where('age').lt(18);","mycollection.find().where('name').eq('foo')","mycollection.find({name:","mycollection.findone('foo')","mycollection.findone().exec();","mycollection.findone().where('name').eq('foo')","mycollection.getlocal('foobar');","mycollection.importdump(json)","mycollection.inmemory();","mycollection.insert({","mycollection.insertlocal(","mycollection.newdocument({","mycollection.postcreate(function(doc){","mycollection.postinsert(function(documentdata){","mycollection.postremove(function(doc){","mycollection.postsave(function(doc){","mycollection.preinsert(function(documentdata){","mycollection.preremove(function(doc){","mycollection.presave(function(doc){","mycollection.remove();","mycollection.sync(","mycollection.upsert(docdata);","mycollection.upsert({","mycollection.upsertlocal(","mydatabase.collection({","mydatabase.destroy();","mydatabase.dump()","mydatabase.dump(true)","mydatabase.insertlocal(","mydatabase.remove();","mydatabase.requestidlepromise().then(()","mydatabase.requestidlepromise(1000","mydb.$.subscribe(changeev","mydocument.$()","mydocument.ag","mydocument.allattachments$.subscribe(","mydocument.allattachments();","mydocument.atomicupdate(function(doc){","mydocument.deleted$.subscribe(st","mydocument.family.mother_;","mydocument.firstnam","mydocument.firstname$","mydocument.friends_;","mydocument.get$('name')","mydocument.get('name');","mydocument.getattachment('cat.jpg');","mydocument.nam","mydocument.name;","mydocument.putattachment({","mydocument.remove();","mydocument.resync();","mydocument.save();","mydocument.set('firstname',","mydocument.set('name',","mydocument.synced$.subscribe(st","mydocument.update({","mydocument.whatever.nestedfield","mydocument.whatever.nestedfield$","mydocument.whatever.nestedfield;","myheroschema","myplugin","myschema","myschema,","name","name.","name:","name:foobar","names.","nativ","need","need.","ness","nest","nestedvalu","never","new","new,","new.","newdocument()","newer","newest","newli","newname;","next","nodej","non","normal","not.","note","noth","notic","notice:","notif","notifi","now","now,","npm","nr;","null","null,","null;","number","number,","number.","object","object,","object.","object.defineproperty(doc,","observ","occur","off,","offlin","ok","old","olddoc.coordinates;","olddoc.sendercountry=response;","olddoc.tim","olddoc;","older","on","once.","open","oper","operations.","operators,","operators.","oplog","optim","optimis","option","options.","options:","origin","orm","orm/drm","other.","otherwis","out","over","overwrit","overwritable:","overwritten","package.json,","package.json.","page","parallel","paramet","parameter,","parameter.","parameters.","parent","parrallel","part","pass","password","password.","password.length","password:","path","peer","per","percent:","percentag","perform","performance,","pick","piec","pleas","plu","plugin","plugin.","plugins:","point","polling.","polyfil","polyfill');","polyfill';","polyfill.","polyfills,","popul","populate()","post","postcreat","postinsert","postremov","postsav","pouch/couch","pouchadaptermemori","pouchdb","pouchdb,","pouchset","power","pr","pre","prefil","preinsert","preremov","presav","prev","prevent","previou","primari","primary,","primary.","primary:","problem","process,","produce,","product","promis","promise(r","promise.","properti","properties:","property.","pros:","proto.hello","protocol.","prototyp","prototypes:","provid","proxi","pseudo","pull","pull:","push:","putattachment()","queri","queries,","queries.","query.","query.$.subscribe(us","query.remove();","query.update({","query:","querychangedetect","querychangedetector","querychangedetector.enable();","querychangedetector.enabledebugging();","queryobject","queryobject.exec();","queryobject.sort('name');","queryobjectsort","queryobjectsort.exec();","quota","ram","rare","re","react","reactiv","reactive,","read","realli","reassign","receiv","recogn","record","reduc","redund","reestablished.","ref","ref:","refer","referenc","refhuman","refind","regex","regex:","regular","relat","releas","reli","remains:","remot","remote:","remov","remove()","removed.","removeddoc","replac","replic","replicated.","replication,","replication.","replications.","replicationst","replicationstate.active$.subscribe(act","replicationstate.cancel();","replicationstate.change$.subscribe(chang","replicationstate.complete$.subscribe(complet","replicationstate.docs$.subscribe(docdata","replicationstate.error$.subscribe(error","repositori","repres","reproduc","request","request,","requestidlecallback","requestidlepromise()","requir","require('babel","require('rxdb');","require('rxdb/plugins/core');","require('rxjs');","required.","required:","resolv","resourc","respons","response.json();","result","result.","resync","resync()","retry:","return","returning.","reus","rev","revis","right","run","run:","running.","runtime,","rx.collection.sync()","rxattach","rxattachemnt","rxchangeevent.","rxcollect","rxcollection().inmemory();","rxcollection,","rxcollection.","rxcollection.insert","rxcollection.newdocument(initaldata).","rxcollection.sync()","rxcollection.sync().","rxcollection:","rxcollections,","rxdatabas","rxdatabase.","rxdb","rxdb'","rxdb,","rxdb.","rxdb.checkadapter('localstorage');","rxdb.create({","rxdb.create({name:","rxdb.isrxcollection(myobj);","rxdb.isrxdatabase(myobj);","rxdb.isrxdocument(myobj);","rxdb.isrxquery(myobj);","rxdb.plugin()","rxdb.plugin(pouchadaptermemory);","rxdb.plugin(require('pouchdb","rxdb.plugin(require('rxdb/plugins/adapt","rxdb.plugin(require('rxdb/plugins/ajv","rxdb.plugin(require('rxdb/plugins/attachments'));","rxdb.plugin(require('rxdb/plugins/encryption'));","rxdb.plugin(require('rxdb/plugins/error","rxdb.plugin(require('rxdb/plugins/in","rxdb.plugin(require('rxdb/plugins/json","rxdb.plugin(require('rxdb/plugins/key","rxdb.plugin(require('rxdb/plugins/lead","rxdb.plugin(require('rxdb/plugins/loc","rxdb.plugin(require('rxdb/plugins/no","rxdb.plugin(require('rxdb/plugins/replication'));","rxdb.plugin(require('rxdb/plugins/schema","rxdb.plugin(require('rxdb/plugins/update'));","rxdb.plugin(require('rxdb/plugins/validate'));","rxdb.plugin(rxdbadaptercheckmodule);","rxdb.plugin(rxdbajvvalidatemodule);","rxdb.plugin(rxdbattachmentsmodule);","rxdb.plugin(rxdbencryptionmodule);","rxdb.plugin(rxdbinmemorymodule);","rxdb.plugin(rxdbjsondumpmodule);","rxdb.plugin(rxdbkeycompressionmodule);","rxdb.plugin(rxdbleaderelectionmodule);","rxdb.plugin(rxdblocaldocumentsmodule);","rxdb.plugin(rxdbnovalidatemodule);","rxdb.plugin(rxdbreplicationmodule);","rxdb.plugin(rxdbschemacheckmodule);","rxdb.plugin(rxdbupdatemodule);","rxdb.plugin(rxdbvalidatemodule);","rxdb.removedatabase('mydatabasename',","rxdb:","rxdbadaptercheckmodul","rxdbajvvalidatemodul","rxdbattachmentsmodul","rxdbencryptionmodul","rxdberrormessagesmodul","rxdbinmemorymodul","rxdbjsondumpmodul","rxdbkeycompressionmodul","rxdbleaderelectionmodul","rxdblocaldocumentsmodul","rxdbnovalidatemodul","rxdbreplicationmodul","rxdbschemacheckmodul","rxdbupdatemodul","rxdbvalidatemodul","rxdocument","rxdocument)","rxdocument,","rxdocument.","rxdocument.atomicupdate.","rxdocument.remov","rxdocument.sav","rxdocument.upd","rxdocument[alice]","rxj","rxjs'","rxlocaldocu","rxlocaldocument.","rxqueri","rxquery'","rxquery.","rxquery.update.","rxreplicationst","rxschema","rxschema.","same","save","save'","save()","save().","save,","saved.","schema","schema\",","schema'","schema,","schema.","schema.org.","schema:","schema?","schemacheck","schemas,","schemas.","schemaversions.","schemawithdefaultag","schemawithfinalag","schemawithindex","scream:","search","second","secondari","seconds.","secret","see","semi","send","sender","sent","seri","server","serverless,","serverless.","serverurl,","set","set()","set).","settimeout(res,","settings:","share","short","show","side","side,","signal","similar","simpl","simple.","singl","site","size,","size.","skeletor!!'","skill","slow","small","solut","solv","someon","someth","sometim","sort","sourc","spawn","spec","special","specif","specifi","speed","src","standard","standart","start","state","state);","static","static.","statics:","stay","still","stop","storag","storage.","store","strategi","stream","stream.","string","string,","string.","structur","subject","submit","subscrib","succeed","success:","sum","support","sure","sync","sync()","sync.","synced$","synced$.","synchron","synchronis","syntax,","system","tab","tab.","table.","tabs,","tabs.","take","task","tasks.","team","temp","temp,","tempdoc","tempdoc.ag","tempdoc.lastnam","tempdoc.save();","temperatur","temporari","ten","test","test/unit","test:nod","tests,","thank","them,","then,","therefor","these","thing","things.","this,","this.","this.nam","this.name;","this:","thousand","through","throw","thrown.","time","time,","time.","time:","timeout","timespan,","timestamp","title:","to,","to.","togeth","top","toplist","total:","track","traffic","transform","transpil","tri","trigger","trivial","true","true);","true,","true.","two","type","type.","type:","typeof","u","undefin","underscor","underscore_","uniqu","unique,","unit","unix","unset","until","up","updat","update()","update/insert/remov","upon","upsert","upsert()","upsertlocal()","us","usag","used:","user","user'","user,","users'","users.","userscollection.find().where('loggedin').eq(true).sort('points');","valid","valid.","validate'));","validate';","validatepassword:","validation.","valu","value,","value.","values.","vanillaj","var","variou","veri","version","version,","version.","version:","versions.","via","visitor","wait","wait..","waitforleadership()","waitforleadership:","want","warn","warning:","wast","way","websit","websocket","whatev","whenev","whether","while,","whoami:","whole","wide","wide.","window","wire","within","without","work","work!","work.","works!","worry,","wrap","write","written","wrong.","you.","z0","z][[a","z][a","za","zero","{","{$eq:","{object}","||","}","})","});","},","};","♛"],"pipeline":["stopWordFilter","stemmer"]},"store":{"./":{"url":"./","title":"Introduction","keywords":"","body":"\n \n \n \n\n\n\n Reactive, serverless, client-side, offline-first database in javascript.\n\n\n\n \n \n \n \n \n \n\n \n -->\n\n\n\n\n If you are new to RxDB, you should start here.\n\n"},"install.html":{"url":"install.html","title":"Install","keywords":"","body":"Install\nnpm\nTo install the latest release of rxdb and its dependencies and save it to your package.json, run:\nnpm i rxdb --save\npeer-dependency\nYou also need to install the peer-dependency rxjs if you not have installed it before.\nnpm i rxjs --save\npolyfills\nRxDB is coded with es8 and transpiled to es5. This means you have to install polyfills to support older browsers.\nnpm i babel-polyfill --save\nLatest\nIf you need the latest develop-state of RxDB, add it as git-dependency into your package.json.\n \"dependencies\": {\n \"rxdb\": \"git+https://git@github.com/pubkey/rxdb.git#commitHash\"\n }\n\nReplace commitHash with the hash of the latest build-commit.\nImport\nTo import rxdb, add this to your javascript file:\n// es6\nimport RxDB from 'rxdb';\n\n// es5\nvar rxdb = require('rxdb');\n\nIf you have not included es8-polyfills, you also have to import babel-polyfill.\n// es6\nimport 'babel-polyfill';\n\n// es5\nrequire('babel-polyfill');\n\nrxjs\nTo reduce the build-size, RxDB is using rxjs's lettable-operators. This means that by default only some parts of rxjs are included into RxDB. If you want to use additional operators, you either have to require the whole rxjs-lib, or also use the lettable-operators. Another alternative is to cherry-pick the needed operators.\n// full import\nimport 'rxjs'; // es6\nrequire('rxjs'); // es5\n\n// lettable\nimport { Subject } from 'rxjs/Subject';\nimport { filter } from 'rxjs/operators/filter';\n\n// cherry-pick\nimport 'rxjs/add/operator/map'; \nimport 'rxjs/add/operator/mergeMap'; \nimport 'rxjs/add/operator/filter'; \nimport 'rxjs/add/operator/first';\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-database.html":{"url":"rx-database.html","title":"RxDatabase","keywords":"","body":"RxDatabase\nA RxDatabase-Object contains your collections and handles the synchronisation of change-events.\nCreation\nThe database is created by the asynchronous .create()-function of the main RxDB-module. It has the following 4 parameters.\nconst db = await RxDB.create({\n name: 'heroesdb', // \nname\nThe database-name is a string which uniquely identifies the database. When two RxDatabases have the same name and use the same storage-adapter, their data can be assumed as equal and they will share change-events between each other.\nDepending on the adapter this can also be used to define the storage-folder of your data.\nadapter\nThe storage-adapter defines where the data is actually stored at. You can use a string for pouchdb-adapters or an object for level-adapters. To use an adapter it must before have been added with the RxDB.plugin()-function.\nBefore using a level-adapter, you have to add the pouchdb-adapter-leveldb module.\nExample with level-adapter:\nimport memdown from 'memdown';\nRxDB.plugin(require('pouchdb-adapter-leveldb'));\nconst db = await RxDB.create({name: 'mydatabase', adapter: memdown});\n\npassword\n(optional)\nIf you want to use encrypted fields in the collections of a database, you have to set a password for it. The password must be a string with at least 12 characters.\nmultiInstance\n(optional=true)\nWhen you create more than one instance of the same database in a single javascript-runtime, you should set multiInstance to true. This will enable the event-sharing between the two instances serverless. This should be set to false when you have single-instances like a single nodejs-process, a react-native-app, a cordova-app or a single-window electron-app.\nignoreDuplicate\n(optional=false)\nIf you create multiple RxDatabase-instances with the same name and same adapter, it's very likely that you have done something wrong.\nTo prevent this common mistake, RxDB will throw an error when you do this.\nIn some rare cases like unit-tests, you want to do this intentional by setting ignoreDuplicate to true.\nconst db1 = await RxDB.create({\n name: 'heroesdb',\n adapter: 'websql',\n ignoreDuplicate: true\n});\nconst db2 = await RxDB.create({\n name: 'heroesdb',\n adapter: 'websql',\n ignoreDuplicate: true // this create-call will not throw because you explicitly allow it\n});\n\nFunctions\nObserve with $\nCalling this will return an rxjs-Observable which streams every change to data of this database.\nmyDb.$.subscribe(changeEvent => console.dir(changeEvent));\n\nwaitForLeadership()\nReturns a Promise which resolves when the RxDatabase becomes elected leader.\ndump()\nUse this function to create a json-export from every piece of data in every collection of this database. You can pass true as a parameter to decrypt the encrypted data-fields of your document.\nmyDatabase.dump()\n .then(json => console.dir(json));\n\n// decrypted dump\nmyDatabase.dump(true)\n .then(json => console.dir(json));\n\nimportDump()\nTo import the json-dumps into your database, use this function.\n// import the dump to the database\nemptyDatabase.importDump(json)\n .then(() => console.log('done'));\n\nrequestIdlePromise()\nReturns a promise which resolves when the database is in idle. This works similar to requestIdleCallback but tracks the idle-ness of the database instead of the CPU.\nUse this for semi-important tasks like cleanups which should not affect the speed of important tasks.\n\nmyDatabase.requestIdlePromise().then(() => {\n // this will run at the moment the database has nothing else to do\n myCollection.customCleanupFunction();\n});\n\n// with timeout\nmyDatabase.requestIdlePromise(1000 /* time in ms */).then(() => {\n // this will run at the moment the database has nothing else to do\n // or the timeout has passed\n myCollection.customCleanupFunction();\n});\n\ndestroy()\nDestroys the databases object-instance. This is to free up memory and stop all observings and replications.\nReturns a Promise that resolves when the database is destroyed.\nawait myDatabase.destroy();\n\nremove()\nRemoves the database and all data of it from the storage.\nawait myDatabase.remove();\n// database is now gone\n\n// NOTICE: You can also remove a database without its instance\nRxDB.removeDatabase('mydatabasename', 'localstorage');\n\ncheckAdapter()\nChecks if the given adapter can be used with RxDB in the current environment.\nRxDB.plugin(require('pouchdb-adapter-localstorage')); // adapter must be added before\n\nconst ok = await RxDB.checkAdapter('localstorage');\nconsole.dir(ok); // true on most browsers, false on nodejs\n\nisRxDatabase\nReturns true if the given object is an instance of RxDatabase. Returns false if not.\nconst is = RxDB.isRxDatabase(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-schema.html":{"url":"rx-schema.html","title":"RxSchema","keywords":"","body":"RxSchema\nSchemas define how your data looks. Which field should be used as primary, which fields should be used as indexes and what should be encrypted. The schema also validates that every inserted document of your collections conforms to the schema. Every collection has its own schema. With RxDB, schemas are defined with the jsonschema-standard so that you don't have to learn anything new.\nExample\nIn this example-schema we define a hero-collection with the following settings:\n\nthe version-number of the schema is 0\nthe name-property is the primary. This means its an unique, indexed, required string which can be used to definitely find a single document.\nthe color-field is required for every document\nthe healthpoints-field must be a number between 0 and 100\nthe secret-field stores an encrypted value\nthe birthyear-field is final which means it is required and cannot be changed\nthe skills-attribute must be an array with objects which contain the name and the damage-attribute. There is a maximum of 5 skills per hero.\n{\n \"title\": \"hero schema\",\n \"version\": 0,\n \"description\": \"describes a simple hero\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"primary\": true\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"healthpoints\": {\n \"type\": \"number\",\n \"min\": 0,\n \"max\": 100\n },\n \"secret\": {\n \"type\": \"string\",\n \"encrypted\": true\n },\n \"birthyear\": {\n \"type\": \"number\",\n \"final\": true,\n \"min\": 1900,\n \"max\": 2050\n },\n \"skills\": {\n \"type\": \"array\",\n \"maxItems\": 5,\n \"uniqueItems\": true,\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"damage\": {\n \"type\": \"number\"\n }\n }\n }\n }\n },\n \"required\": [\"color\"]\n}\n\n\n\nCreate a collection with the schema\nawait myDatabase.collection({\n name: 'heroes',\n schema: myHeroSchema\n});\nconsole.dir(myDatabase.heroes.name);\n// heroes\n\nversion\nThe version field is a number, starting with 0.\nWhen the version is greater than 0, you have to provide the migrationStrategies to create a collection with this schema.\ndisableKeyCompression\nIf you do not want to use the internal key-compression, you can disable it by setting the field disableKeyCompression to true.\nNotice that disableKeyCompression can only be used on the top-level of a schema.\nconst mySchema = {\n disableKeyCompression: true,\n version: 0,\n title: 'human schema no compression',\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n }\n },\n required: ['firstName', 'lastName']\n};\n\nIndexes\nRxDB supports secondary indexes which are defined at the schema-level of the collection.\nTo add a simple index, add index: true inside field options.\nTo add compound-indexes, add them in an array to a compoundIndexes-field at the top-level of the schema-definition.\nIndex is only allowed on field types string, integer and number\nIndex-example\nconst schemaWithIndexes = {\n disableKeyCompression: true,\n version: 0,\n title: 'human schema no compression',\n type: 'object',\n properties: {\n firstName: {\n type: 'string',\n index: true // \ndefault\nDefault values can only be defined for first-level fields.\nWhenever you insert a document or create a temporary-document, unset fields will be filled with default-values.\nconst schemaWithDefaultAge = {\n version: 0,\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n },\n age: {\n type: 'integer',\n default: 20 // \nfinal\nBy setting a field to final, you make sure it cannot be modified later. Final fields are always required.\nFinal fields cannot be observed because they anyway will not change.\nAdvantages:\n- With final fields you can ensure that no other in your dev-team accidentally modifies the data\n- When you enable the `query-change-detection`, some performance-improvements are done\nconst schemaWithFinalAge = {\n version: 0,\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n },\n age: {\n type: 'integer',\n final: true\n }\n },\n};\n\nNOTICE: Not everything within the jsonschema-spec is allowed\nThe schema is not only used to validate objects before they are written into the database, but also used to map getters to observe and populate single fieldnames, keycompression and other things. Therefore you can not use every schema which would be valid for the spec of json-schema.org.\nFor example, fieldnames must match the regex ^[a-zA-Z][[a-zA-Z0-9_]*]?[a-zA-Z0-9]$ and additionalProperties is always set to false. But don't worry, RxDB will instantly throw an error when you pass a invalid schema into it.\n\nIf you are new to RxDB, you should continue here\n"},"rx-collection.html":{"url":"rx-collection.html","title":"RxCollection","keywords":"","body":"RxCollection\nA collection stores documents of the same type.\nCreating a Collection\nTo create a collection you need a RxDatabase object which has the .collection()-method. Every collection needs a collection name and a valid RxSchema.\nmyDatabase.collection({\n name: 'humans',\n schema: mySchema\n})\n .then(collection => console.dir(collection));\n\nname\nThe name uniquely identifies the collection and should be used to refind the collection in the database. Two different collections in the same database can never have the same name. Collection names must match the following regex: ^[a-z][a-z0-9]*$.\nschema\nThe schema defines how your data looks and how it should be handled. You can pass a RxSchema object or a simple javascript-object from which the schema will be generated.\npouchSettings\nYou can pass settings directly to the pouchdb database create options through this property.\nGet a collection from the database\nTo get an existing collection from the database, call the collection name directly on the database:\n// newly created collection\nconst collection = await db.collection({\n name: 'heroes',\n schema: mySchema\n});\nconst collection2 = db.heroes;\n// or\n// const collection2 = db['heroes']\n\nconsole.log(collection == collection2);\n// true\n\nFunctions\nObserve $\nCalling this will return an rxjs-Observable which streams every change to data of this collection.\nmyCollection.$.subscribe(changeEvent => console.dir(changeEvent));\n\ninsert()\nUse this to insert new documents into the database. The collection will validate the schema and automatically encrypt any encrypted fields. Returns the new RxDocument.\nconst doc = await myCollection.insert({\n name: 'foo',\n lastname: 'bar'\n});\n\nnewDocument()\nSometimes it can be helpful to spawn and use documents before saving them into the database.\nThis is useful especially when you want to use the ORM methods or prefill values from form data.\nYou can create temporary documents by calling RxCollection.newDocument(initalData).\nconst tempDoc = myCollection.newDocument({\n firstName: 'Bob'\n});\n\n// fill in data later\ntempDoc.lastName = 'Kelso';\ntempDoc.age = 77;\n\n// saving a temporary document will transform it to a standard RxDocument\nawait tempDoc.save();\n\nupsert()\nInserts the document if it does not exist within the collection, otherwise it will overwrite it. Returns the new or overwritten RxDocument.\nconst doc = await myCollection.upsert({\n name: 'foo',\n lastname: 'bar2'\n});\n\natomicUpsert()\nWhen you run many upsert operations on the same RxDocument in a very short timespan, you might get a 409 Conflict error.\nThis means that you tried to run a .upsert() on the document, while the previous upsert operation was still running.\nTo prevent these types of errors, you can run atomic upsert operations.\nThe behavior is similar to RxDocument.atomicUpdate.\nconst docData = {\n name: 'Bob', // primary\n lastName: 'Kelso'\n};\n\nmyCollection.upsert(docData);\nmyCollection.upsert(docData);\n// -> throws because of parrallel update to the same document\n\nmyCollection.atomicUpsert(docData);\nmyCollection.atomicUpsert(docData);\nmyCollection.atomicUpsert(docData);\n\n// wait until last upsert finished\nawait myCollection.atomicUpsert(docData);\n// -> works\n\nfind()\nTo find documents in your collection, use this method.\nThis will return a RxQuery object with the exec function.\n// directly pass search-object\nmyCollection.find({name: {$eq: 'foo'}})\n .exec().then(documents => console.dir(documents));\n\n// chained queries\nmyCollection.find().where('name').eq('foo')\n .exec().then(documents => console.dir(documents));\n\nfindOne()\nThis does basically what find() does, but it returns only a single document. You can pass a primary value to find a single document more easily.\n// get document with name:foobar\nmyCollection.findOne().where('name').eq('foo')\n .exec().then(doc => console.dir(doc));\n\n// get document by primary, functionally identical to above query\nmyCollection.findOne('foo')\n .exec().then(doc => console.dir(doc));\n\ndump()\nUse this function to create a json export from every document in the collection. You can pass true as parameter to decrypt the encrypted data fields of your documents.\nmyCollection.dump()\n .then(json => console.dir(json));\n\n// decrypted dump\nmyCollection.dump(true)\n .then(json => console.dir(json));\n\nimportDump()\nTo import the json dump into your collection, use this function.\n// import the dump to the database\nmyCollection.importDump(json)\n .then(() => console.log('done'));\n\ndestroy()\nDestroys the collection's object instance. This is to free up memory and stop all observings and replications.\nmyDatabase.destroy();\n\nsync()\nThis method allows you to replicate data between other RxCollections, pouchdb instances or remove servers which support the couchdb-sync-protocol.\nFull documentation on how to use replication is here.\nremove()\nRemoves all known data of the collection and its previous versions.\nThis removes the documents, the schemas, and older schemaVersions.\nawait myCollection.remove();\n// collection is now removed and can be re-created\n\nisRxCollection\nReturns true if the given object is an instance of RxCollection. Returns false if not.\nconst is = RxDB.isRxCollection(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-document.html":{"url":"rx-document.html","title":"RxDocument","keywords":"","body":"RxDocument\nA document is a single object which is stored in a collection. It can be compared to a single record in a relational database table.\ninsert\nTo insert a document into a collection, you have to call the collection's .insert()-function.\nmyCollection.insert({\n name: 'foo',\n lastname: 'bar'\n});\n\nfind\nTo find documents in a collection, you have to call the collection's .find()-function.\nmyCollection.find().exec() // console.dir(documents));\n\nFunctions\nget()\nThis will get a single field of the document. If the field is encrypted, it will be automatically decrypted before returning.\nvar name = myDocument.get('name'); // returns the name\n\nproxy-get\nAs RxDocument is wrapped into a Proxy-object, you can also directly access values instead of using the get()-function.\n // Identical to myDocument.get('name');\n var name = myDocument.name;\n // Can also get nested values.\n var nestedValue = myDocument.whatever.nestedfield;\n\nset()\nTo change data in your document, use this function. It takes the field-path and the new value as parameter. Note that calling the set-function will not change anything in your storage directly. You have to call .save() after to submit changes.\nmyDocument.set('firstName', 'foobar');\nconsole.log(myDocument.get('firstName')); // \nproxy-set\nAs RxDocument is wrapped into a Proxy-object, you can also directly set values instead of using the set()-function.\nmyDocument.firstName = 'foobar';\nmyDocument.whatever.nestedfield = 'foobar2';\n\nsave()\nThis will update the document in the storage if it has been changed. Call this after modifying the document (via set() or proxy-set).\nmyDocument.name = 'foobar';\nawait myDocument.save(); // submit the changes to the storage\n\nremove()\nThis removes the document from the collection.\nmyDocument.remove();\n\nupdate()\nUpdates the document based on the mongo-update-syntax, based on modifyjs.\nawait myDocument.update({\n $inc: {\n age: 1 // increases age by 1\n },\n $set: {\n fistName: 'foobar' // sets firstName to foobar\n }\n});\n\natomicUpdate()\nWhen you run many save-operations on the same RxDocument in a very short timespan, it can happen that you get a 409 Conflict-Error.\nThis means that you did run a .save() on the document, while the previous save-operation was still running.\nTo prevent these types of errors, you can run atomic update-operations.\natomicUpdate() has a function as argument, which transforms the document and then automatically runs a save().\nIt returns a promise to notify you when the given atomic-update has finished.\nExample to reproduce the 409-error:\n[1,2,3,4].forEach(nr => {\n myDocument.age = nr;\n myDocument.save();\n});\n// throws\n\nUsage of atomicUpdate:\nlet lastPromise;\n[1,2,3,4].forEach(nr => {\n lastPromise = myDocument.atomicUpdate(function(doc){\n doc.age = nr;\n });\n});\nawait lastPromise;\nconsole.dir(myDocument.age); // 4\n\nObserve $\nCalling this will return an rxjs-Observable which emits all change-Events belonging to this document.\n// get all changeEvents\nmyDocument.$()\n .subscribe(changeEvent => console.dir(changeEvent));\n\nget$()\nThis function returns an observable of the given paths-value.\nThe current value of this path will be emitted each time the document changes.\n// get the life-updating value of 'name'\nvar isName;\nmyDocument.get$('name')\n .subscribe(newName => {\n isName = newName;\n });\n\nmyDocument.set('name', 'foobar2');\nawait myDocument.save();\n\nconsole.dir(isName); // isName is now 'foobar2'\n\nproxy-get$\nYou can directly get value-observables for a fieldName by adding the dollarSign ($) to its name.\n// top-level\nvar currentName;\nmyDocument.firstName$\n .subscribe(newName => {\n currentName = newName;\n });\nmyDocument.firstName = 'foobar2';\nawait myDocument.save();\nconsole.dir(currentName); // currentName is now 'foobar2'\n\n// nested\nvar currentNestedValue;\nmyDocument.whatever.nestedfield$\n .subscribe(newName => {\n currentNestedValue = newName;\n });\nmyDocument.whatever.nestedfield = 'foobar2';\nawait myDocument.save();\nconsole.dir(currentNestedValue); // currentNestedValue is now 'foobar2'\n\ndeleted$\nEmits a boolean value, depending on whether the RxDocument is deleted or not.\nlet lastState = null;\nmyDocument.deleted$.subscribe(state => lastState = state);\n\nconsole.log(lastState);\n// false\n\nawait myDocument.remove();\n\nconsole.log(lastState);\n// true\n\nget deleted\nA getter to get the current value of deleted$.\nconsole.log(myDocument.deleted);\n// false\n\nawait myDocument.remove();\n\nconsole.log(myDocument.deleted);\n// true\n\nsynced$\nEmits a boolean value of whether the RxDocument is in the same state as its value stored in the database.\nThis is useful to show warnings when two or more users edit a document at the same time.\nBrowser tab A\nlet lastState = null;\nmyDocument.synced$.subscribe(state => lastState = state);\nconsole.log(lastState);\n// true\n\nmyDocument.firstName = 'foobar';\nconsole.log(lastState);\n// true\n\nBrowser tab B\nmyDocument.firstName = 'barfoo';\nawait myDocument.save();\n\nBrowser tab A\nconsole.log(lastState);\n// false\n\n\n\n Example with Angular 2\n\n\n```html\n\n Warning:\n Someone else has changed this document. If you click save, you will overwrite the changes.\n resync\n\n```\n\n![synced.gif](files/synced.gif)\n\n\nget synced\nA getter to get the current value of synced$.\nBrowser tab A\nconsole.log(myDocument.synced);\n// true\n\nmyDocument.firstName = 'foobar';\nconsole.log(myDocument.synced);\n// true\n\nBrowser tab B\nmyDocument.firstName = 'barfoo';\nawait myDocument.save();\n\nBrowser tab A\nconsole.log(myDocument.synced);\n// false\n\nresync()\nIf the RxDocument is not in sync (synced$ fires false), you can run resync() to overwrite own changes with the new state from the database.\nmyDocument.firstName = 'foobar';\n\n// now someone else overwrites firstName with 'Alice'\n\nmyDocument.resync();\n\nconsole.log(myDocument.firstName);\n// Alice\n\nisRxDocument\nReturns true if the given object is an instance of RxDocument. Returns false if not.\nconst is = RxDB.isRxDocument(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-query.html":{"url":"rx-query.html","title":"RxQuery","keywords":"","body":"RxQuery\nA query defines how to find documents in your collection. With RxDB you can use chained queries.\nremove()\nDeletes all found documents. Returns a promise which resolves to the deleted documents.\n// All documents where the age is less than 18\nconst query = myCollection.find().where('age').lt(18);\n// Remove the documents from the collection\nconst removedDocs = await query.remove();\n\nupdate()\nRuns and update on every RxDocument of the query-result.\nconst query = myCollection.find().where('age').gt(18);\nawait query.update({\n $inc: {\n age: 1 // increases age of every found document by 1\n }\n});\n\nNOTICE: RxQuery's are immutable\nBecause RxDB is a reactive database, we can do heavy performance-optimisation on query-results which change over time. To be able to do this, RxQuery's have to be immutable.\nThis means, when you have a RxQuery and run a .where() on it, the original RxQuery-Object is not changed. Instead the where-function returns a new RxQuery-Object with the changed where-field. Keep this in mind if you create RxQuery's and change them afterwards.\nExample:\nconst queryObject = myCollection.find().where('age').gt(18);\n// Creates a new RxQuery object, does not modify previous one\nqueryObject.sort('name');\nconst results = await queryObject.exec();\nconsole.dir(results); // result-documents are not sorted by name\n\nconst queryObjectSort = queryObject.sort('name');\nconst results = await queryObjectSort.exec();\nconsole.dir(results); // result-documents are now sorted\n\nisRxQuery\nReturns true if the given object is an instance of RxQuery. Returns false if not.\nconst is = RxDB.isRxQuery(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-attachment.html":{"url":"rx-attachment.html","title":"RxAttachment","keywords":"","body":"Attachments\nLike pouchdb, RxDB can store attachments which has a better performance and a higher quota-limit then regular data.\nYou can store string, binary files, images and whatever you want side by side with your documents.\nBefore you can use attachments, you have to ensure that the attachments-object is set in the schema of your RxCollection.\n\nconst mySchema = {\n version: 0,\n type: 'object',\n properties: {\n // .\n // .\n // .\n },\n attachments: {\n encrypted: true // if true, the attachment-data will be encrypted with the db-password\n }\n};\n\nconst myCollection = await myDatabase.collection({\n name: 'humans',\n schema: mySchema\n});\n\nputAttachment()\nAdds an attachment to a RxDocument. Returns a Promise with the new attachment.\nconst attachment = await myDocument.putAttachment({\n id, // string, name of the attachment like 'cat.jpg'\n data, // (string|Blob|Buffer) data of the attachment\n type // (string) type of the attachment-data like 'image/jpeg'\n});\n\ngetAttachment()\nReturns an RxAttachment by its id. Returns null when the attachment does not exist.\nconst attachment = myDocument.getAttachment('cat.jpg');\n\nallAttachments()\nReturns an array of all attachments of the RxDocument.\nconst attachments = myDocument.allAttachments();\n\nallAttachments$\nGets an Observable which emits a stream of all attachments from the document. Re-emits each time an attachment gets added or removed from the RxDocument.\nconst all = [];\nmyDocument.allAttachments$.subscribe(\n attachments => all = attachments\n);\n\nRxAttachment\nThe attachments of RxDB are represented by the type RxAttachment which has the following attributes/methods.\ndoc\nThe RxDocument which the attachment is assigned to.\nid\nThe id as string of the attachment.\ntype\nThe type as string of the attachment.\nlength\nThe length of the data of the attachment as number.\ndigest\nThe md5-sum of the attachments data as string.\nrev\nThe revision-number of the attachment as number.\nremove()\nRemoves the attachment. Returns a Promise that resolves when done.\nconst attachment = myDocument.getAttachment('cat.jpg');\nawait attachment.remove();\n\ngetData()\nReturns a Promise which resolves the attachment's data as Blob or Buffer. (async)\nconst attachment = myDocument.getAttachment('cat.jpg');\nconst blobBuffer = await attachment.getData();\n\ngetStringData()\nReturns a Promise which resolves the attachment's data as string.\nconst attachment = await myDocument.getAttachment('cat.jpg');\nconst data = await attachment.getStringData();\n\n\nIf you are new to RxDB, you should continue here\n"},"middleware.html":{"url":"middleware.html","title":"Middleware-hooks","keywords":"","body":"Middleware\nRxDB supports middleware-hooks like mongoose.\nMiddleware (also called pre and post hooks) are functions which are passed control during execution of asynchronous functions.\nThe hooks are specified on RxCollection-level and help to create a clear what-happens-when-structure of your code.\nHooks can be defined to run parallel or as series one after another.\nHooks can be synchronous or asynchronous when they return a Promise.\nTo stop the operation at a specific hook, throw an error.\nList\nRxDB supports the following hooks:\n\npreInsert\npostInsert\npreSave\npostSave\npreRemove\npostRemove\npostCreate\n\nWhy is there no validate-hook?\nDifferent to mongoose, the validation on document-data is running on the field-level for every change to a document.\nThis means if you set the value lastName of a RxDocument, then the validation will only run on the changed field, not the whole document.\nTherefore it is not useful to have validate-hooks when a document is written to the database.\nUse Cases\nMiddleware are useful for atomizing model logic and avoiding nested blocks of async code.\nHere are some other ideas:\n\ncomplex validation\nremoving dependent documents\nasynchronous defaults\nasynchronous tasks that a certain action triggers\ntriggering custom events\nnotifications\n\nUsage\nInsert\nAn insert-hook receives the data-object of the new document.\nlifecycle\n\nRxCollection.insert is called\npreInsert series-hooks\npreInsert parallel-hooks\nschema validation runs\nnew document is written to database\npostInsert series-hooks\npostInsert parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreInsert\n// series\nmyCollection.preInsert(function(documentData){\n\n}, false);\n\n// parallel\nmyCollection.preInsert(function(documentData){\n\n}, true);\n\n// async\nmyCollection.preInsert(function(documentData){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the insert-operation\nmyCollection.preInsert(function(documentData){\n throw new Error('stop');\n}, false);\n\npostInsert\n// series\nmyCollection.postInsert(function(documentData){\n\n}, false);\n\n// parallel\nmyCollection.postInsert(function(documentData){\n\n}, true);\n\n// async\nmyCollection.postInsert(function(documentData){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\nSave\nA save-hook receives the document which is saved.\nlifecycle\n\nRxDocument.save is called\npreSave series-hooks\npreSave parallel-hooks\nupdated document is written to database\npostSave series-hooks\npostSave parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreSave\n// series\nmyCollection.preSave(function(doc){\n doc.anyField = 'anyValue';\n}, false);\n\n// parallel\nmyCollection.preSave(function(doc){\n\n}, true);\n\n// async\nmyCollection.preSave(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the save-operation\nmyCollection.preSave(function(doc){\n throw new Error('stop');\n}, false);\n\npostSave\n// series\nmyCollection.postSave(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.postSave(function(doc){\n\n}, true);\n\n// async\nmyCollection.postSave(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\nRemove\nAn remove-hook receives the document which is removed.\nlifecycle\n\nRxDocument.remove is called\npreRemove series-hooks\npreRemove parallel-hooks\ndeleted document is written to database\npostRemove series-hooks\npostRemove parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreSave\n// series\nmyCollection.preRemove(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.preRemove(function(doc){\n\n}, true);\n\n// async\nmyCollection.preRemove(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the remove-operation\nmyCollection.preRemove(function(doc){\n throw new Error('stop');\n}, false);\n\npostRemove\n// series\nmyCollection.postRemove(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.postRemove(function(doc){\n\n}, true);\n\n// async\nmyCollection.postRemove(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\npostCreate\nThis hook is called whenever a RxDocument is constructed.\nYou can use postCreate to modify every RxDocument-instance of the collection.\nThis adds a flexible way to add specify behavior to every document. You can also use it to add custom getter/setter to documents. PostCreate-hooks cannot be asynchronous.\nmyCollection.postCreate(function(doc){\n Object.defineProperty(doc, 'myField', {\n get: () => 'foobar',\n });\n});\n\nconst doc = await myCollection.findOne().exec();\n\nconsole.log(doc.myField);\n// 'foobar'\n\nNotice: This hook does not run on already created or cached documents. Make sure to add postCreate-hooks before interacting with the collection.\n\nIf you are new to RxDB, you should continue here\n"},"orm.html":{"url":"orm.html","title":"ORM/DRM","keywords":"","body":"Object-Data-Relational-Mapping\nLike mongoose, RxDB has ORM-capabilities which can be used to add specific behavior to documents and collections.\nstatics\nStatics are defined collection-wide and can be called on the collection.\nAdd statics to a collection\nTo add static functions, pass a statics-object when you create your collection. The object contains functions, mapped to their function-names.\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n statics: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\n\nconsole.log(heroes.scream());\n// 'AAAH!!'\n\nYou can also use the this-keyword which resolves to the collection:\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n statics: {\n whoAmI: function(){\n this.name;\n }\n }\n});\nconsole.log(heroes.whoAmI());\n// 'heroes'\n\ninstance-methods\nInstance-methods are defined collection-wide. They can be called on the RxDocuments of the collection.\nAdd instance-methods to a collection\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n methods: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\nconst doc = await heroes.findOne().exec();\nconsole.log(doc.scream());\n// 'AAAH!!'\n\nHere you can also use the this-keyword:\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n methods: {\n whoAmI: function(){\n return 'I am ' + this.name + '!!';\n }\n }\n});\nawait heroes.insert({\n name: 'Skeletor'\n});\nconst doc = await heroes.findOne().exec();\nconsole.log(doc.whoAmI());\n// 'I am Skeletor!!'\n\nattachment-methods\nAttachment-methods are defined collection-wide. They can be called on the RxAttachemnts of the RxDocuments of the collection.\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n attachments: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\nconst doc = await heroes.findOne().exec();\nconst attachment = await doc.putAttachment({\n id: 'cat.txt',\n data: 'meow I am a kitty',\n type: 'text/plain'\n});\nconsole.log(attachment.scream());\n// 'AAAH!!'\n\n\nIf you are new to RxDB, you should continue here\n"},"population.html":{"url":"population.html","title":"Population","keywords":"","body":"Population\nThere are no joins in RxDB but sometimes we still want references to documents in other collections. This is where population comes in. You can specify a relation from one RxDocument to another RxDocument in the same or another RxCollection of the same database.\nThen you can get the referenced document with the population-getter.\nThis works exactly like population with mongoose.\nSchema with ref\nThe ref-keyword describes to which collection the field-value belongs to.\nexport const refHuman = {\n title: 'human related to other human',\n version: 0,\n properties: {\n name: {\n primary: true,\n type: 'string'\n },\n bestFriend: {\n ref: 'human', // refers to collection human\n type: 'string' // ref-values must always be string (primary of foreign RxDocument)\n }\n }\n};\n\npopulate()\nvia method\nTo get the referred RxDocument, you can use the populate()-method.\nIt takes the field-path as attribute and returns a Promise which resolves to the foreign document or null if not found.\nawait humansCollection.insert({\n name: 'Alice',\n bestFriend: 'Carol'\n});\nawait humansCollection.insert({\n name: 'Bob',\n bestFriend: 'Alice'\n});\nconst doc = await humansCollection.findOne('Bob').exec();\nconst bestFriend = await doc.populate('bestFriend');\nconsole.dir(bestFriend); //> RxDocument[Alice]\n\nvia getter\nYou can also get the populated RxDocument with the direct getter. Therefore you have to add the underscore _ to the fieldname.\nThis works also on nested values.\nawait humansCollection.insert({\n name: 'Alice',\n bestFriend: 'Carol'\n});\nawait humansCollection.insert({\n name: 'Bob',\n bestFriend: 'Alice'\n});\nconst doc = await humansCollection.findOne('Bob').exec();\nconst bestFriend = await doc.bestFriend_; // notice the underscore_\nconsole.dir(bestFriend); //> RxDocument[Alice]\n\nExample with nested reference\nconst myCollection = await myDatabase.collection({\n name: 'human',\n schema: {\n version: 0,\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n family: {\n type: 'object',\n properties: {\n mother: {\n type: 'string',\n ref: 'human'\n }\n }\n }\n }\n }\n});\n\nconst mother = await myDocument.family.mother_;\nconsole.dir(mother); //> RxDocument\n\nExample with array\nconst myCollection = await myDatabase.collection({\n name: 'human',\n schema: {\n version: 0,\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n friends: {\n type: 'array',\n ref: 'human',\n items: {\n type: 'string'\n }\n }\n }\n }\n});\n\n//[insert other humans here]\n\nawait myCollection.insert({\n name: 'Alice',\n friends: [\n 'Bob',\n 'Carol',\n 'Dave'\n ]\n});\n\nconst doc = await humansCollection.findOne('Alice').exec();\nconst friends = await myDocument.friends_;\nconsole.dir(friends); //> Array.\n\n\nIf you are new to RxDB, you should continue here\n"},"data-migration.html":{"url":"data-migration.html","title":"DataMigration","keywords":"","body":"DataMigration\nImagine you have your awesome messenger-app distributed to many users. After a while, you decide that in your new version, you want to change the schema of the messages-collection. Instead of saving the message-date like 2017-02-12T23:03:05+00:00 you want to have the unix-timestamp like 1486940585 to make it easier to compare dates. To accomplish this, you change the schema and increase the version-number and you also change your code where you save the incoming messages. But one problem remains: what happens with the messages which are already saved on the user's device in the old schema?\nWith RxDB you can provide migrationStrategies for your collections that automatically (or on call) transform your existing data from older to newer schemas. This assures that the client's data always matches your newest code-version.\nProviding strategies\nUpon creation of a collection, you have to provide migrationStrategies when your schema's version-number is greater than 0. To do this, you have to add an object to the migrationStrategies property where a function for every schema-version is assigned. A migrationStrategy is a function which gets the old document-data as a parameter and returns the new, transformed document-data. If the strategy returns null, the document will be removed instead of migrated.\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n // 1 means, this transforms data from version 0 to version 1\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n }\n }\n});\n\nAsynchronous strategies can also be used:\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n },\n /**\n * 2 means, this transforms data from version 1 to version 2\n * this returns a promise which resolves with the new document-data\n */\n 2: function(oldDoc){\n // in the new schema (version: 2) we defined 'senderCountry' as required field (string)\n // so we must get the country of the message-sender from the server\n const coordinates = oldDoc.coordinates;\n return fetch('http://myserver.com/api/countryByCoordinates/'+coordinates+'/')\n .then(response => {\n const response = response.json();\n oldDoc.senderCountry=response;\n return oldDoc;\n });\n }\n }\n});\n\nyou can also filter which documents should be migrated:\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n // 1 means, this transforms data from version 0 to version 1\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n },\n /**\n * this removes all documents older then 2017-02-12\n * they will not appear in the new collection\n */\n 2: function(oldDoc){\n if(oldDoc.time \nautoMigrate\nBy default, the migration automatically happens when the collection is created. If you have lots of data or the migrationStrategies take a long time, it might be better to start the migration 'by hand' and show the migration-state to the user as a loading-bar.\nconst messageCol = await myDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n autoMigrate: false, // console.dir(state),\n error => console.error(error),\n done => console.log('done')\n);\n\n// the emitted states look like this:\n{\n done: false, // true if finished\n total: 50, // amount of documents which must be migrated\n handled: 0, // amount of handled docs\n success: 0, // handled docs which succeeded\n deleted: 0, // handled docs which got deleted\n percent: 0 // percentage\n}\n\nIf you don't want to show the state to the user, you can also use .migratePromise():\n const migrationPromise = messageCol.migratePromise(10);\n await migratePromise;\n\nHint\nIf your migration takes a long time, combine it with the leaderElection to make sure you don't waste your users' resources by running it in 2 open tabs.\n\nIf you are new to RxDB, you should continue here\n"},"leader-election.html":{"url":"leader-election.html","title":"LeaderElection","keywords":"","body":"Leader-Election\nBefore you read this, please check out on how many of your open browser-tabs you have opened the same website more than once. Count them, I will wait..\nSo if you would now inspect the traffic that theses open tabs produce, you can see that many of them send exact the same data over wire for every tab. No matter if the data is sent with an open websocket or by polling.\nUse-case-example\nImagine we have a website which displays the current temperature of the visitors location in various charts, numbers or heatmaps. To always display the live-data, the website opens a websocket to our API-Server which sends the current temperature every 10 seconds. Using the way most sites are currently build, we can now open it in 5 browser-tabs and it will open 5 websockets which send data 6*5=30 times per minute. This will not only waste the power of your clients device, but also wastes your api-servers resources by opening redundant connections.\nSolution\nThe solution to this redundancy is the usage of a leader-election-algorithm which makes sure that always exactly one tab is managing the remote-data-access. The managing tab is the elected leader and stays leader until it is closed. No matter how many tabs are opened or closed, there must be always exactly one leader.\nYou could now start implementing a messaging-system between your browser-tabs, hand out which one is leader, solve conflicts and reassign a new leader when the old one 'dies'.\nOr just use RxDB which does all these things for you.\nCode-example\nTo make it easy, here is an example where the temperature is pulled every ten seconds and saved to a collection. The pulling starts at the moment where the opened tab becomes the leader.\nconst db = await RxDB.create({\n name: 'weatherDB',\n adapter: 'localstorage',\n password: 'myPassword',\n multiInstance: true\n});\nawait db.collection({\n name: 'temperature',\n schema: mySchema\n});\n\ndb.waitForLeadership()\n .then(() => {\n console.log('Long lives the king!'); // {\n const temp = await fetch('https://example.com/api/temp/');\n db.temperature.insert({\n degrees: temp,\n time: new Date().getTime()\n });\n }, 1000 * 10);\n });\n\nLive-Example\nIn this example the leader is marked with the crown ♛\n\nTry it out\nRun the vanillaJS-example where the leading tab is marked with a crown on the top-right-corner.\n\nIf you are new to RxDB, you should continue here\n"},"replication.html":{"url":"replication.html","title":"Replication","keywords":"","body":"Replication\nOne of the most powerful features with CouchDB, PouchDB and RxDB is sync.\nYou can sync every RxCollection with another RxCollection, a PouchDB-instance or a remote pouch/couch-DB.\nRx.Collection.sync()\nTo replicate the collection with another instance, use RxCollection.sync().\nIt basically does the same as pouchdb-sync but also adds event-handlers to make sure that change-events will be recognized in the internal event-stream.\n\n// you need these plugins to sync\nRxDB.plugin(require('pouchdb-adapter-http')); // enable syncing over http (remote database)\n\nconst replicationState = myCollection.sync(\n remote: 'http://localhost:10102/db/', // remote database. This can be the serverURL, another RxCollection or a PouchDB-instance\n waitForLeadership: true, // (optional) [default=true] to save performance, the sync starts on leader-instance only\n direction: { // direction (optional) to specify sync-directions\n pull: true, // default=true\n push: true // default=true\n },\n options: { // sync-options (optional) from https://pouchdb.com/api.html#replication\n live: true,\n retry: true\n },\n query: myCollection.find().where('age').gt(18) // query (optional) only documents that match that query will be synchronised\n);\n\nRxReplicationState\nThe method RxCollection.sync() returns a RxReplicationState which can be used to observe events via rxjs-observables and to cancel the replication.\nchange$\nEmits the change-events every time some documents get replicated.\nreplicationState.change$.subscribe(change => console.dir(change));\n\ndocs$\nEmits each replicated document-data.\nreplicationState.docs$.subscribe(docData => console.dir(docData));\n\nactive$\nEmits true or false depending if the replication is running. For example if you sync with a remote server and the connection dies, this is false until the connection can be reestablished.\nreplicationState.active$.subscribe(active => console.dir(active));\n\ncomplete$\nEmits true or false depending if the replication is completed.\nIf you do a live: true-sync (default) the replication never completes.\nOnly one-time-replications will complete.\nreplicationState.complete$.subscribe(completed => console.dir(completed));\n\nerror$\nIf errors occur during the replication, they will get emitted here.\nreplicationState.error$.subscribe(error => console.dir(error));\n\ncancel()\nCalling this method will cancel the replication.\nawait replicationState.cancel(); // cancel() is async\n\n\nIf you are new to RxDB, you should continue here\n"},"query-change-detection.html":{"url":"query-change-detection.html","title":"QueryChangeDetection","keywords":"","body":"QueryChangeDetection\nSimilar to Meteors oplog-observe-driver,\nRxDB has a QueryChangeDetection to optimize observed or reused queries. This makes sure that when you update/insert/remove documents, the query does not have to re-run over the whole database but the new results will be calculated from the events. This creates a huge performance gain with zero cost.\nNOTICE:\nQueryChangeDetection is currently in beta and disabled by default.\nYou can enable it by calling the enable()-function on its module.\nimport { QueryChangeDetector } from 'rxdb';\nQueryChangeDetector.enable();\nQueryChangeDetector.enableDebugging(); // shows a console.log everytime an optimisation is made\n\nUse-case-example\nImagine you have a very big collection with many user-documents. At your page you want to display a toplist with users which have the most points and are currently logged in.\nYou create a query and subscribe to it.\nconst query = usersCollection.find().where('loggedIn').eq(true).sort('points');\nquery.$.subscribe(users => {\n document.querySelector('body').innerHTML = users\n .reduce((prev, cur) => prev + cur.username+ '', '');\n});\n\nAs you may detect, the query can take a very long time to run because you have thousands of users in the collection.\nThen, when a user logs off, the whole query will re-run over the database which takes a really long time yet again.\nanyUser.loggedIn = false;\nawait anyUser.save();\n\nBut not with QueryChangeDetection enabled.\nNow, when one user logs off, it will calculate the new results from the current results plus the RxChangeEvent. This can often be done in-memory without making IO-requests to the storage-engine. QueryChangeDetection not only works on subscribed queries, but also when you do multiple .exec()'s on the same query.\n\nIf you are new to RxDB, you should continue here\n"},"in-memory.html":{"url":"in-memory.html","title":"InMemory","keywords":"","body":"in-memory\nWhen you do a heavy amount of operations on a RxCollection, you might want to optimize this by using the in-memory-replication of the collection. The in-memory-replication behaves equal to the original collection but is stored in the Ram of your computer.\nRxCollection().inMemory();\nReturns a promise that resolves with another RxCollection that is the in-memory-replicated version of the original collection. The memory-collection has the same documents as it's parent and also shares the same event-stream.\n\n// IMPORTANT: You have to add the memory-adapter before you can use inMemory-Collections\n// RUN 'npm install pouchdb-adapter-memory --save'\nimport PouchAdapterMemory from 'pouchdb-adapter-memory';\nRxDB.plugin(PouchAdapterMemory);\n\nconst memCol = await myCollection.inMemory();\n\n// now u can use memCol as it would be myCollection\nconst docs = await memCol.find().exec(); // has same result as on the original collection\n\nencryption\nEncrypted fields are automatically decrypted inside of the memory-collection. This means you can do queries over encrypted fields.\nreplication\nThe memory-collection is two-way-replicated with its original collection. This means when you change documents on one of them, the update and the change-event will fire on both.\nPros:\n\nFaster queries\nFaster writes\nQuerying works over encrypted fields\n\nCons:\n\nThe original collection has to be small enough to fit into the memory\nNo attachment-support\nInitial creation takes longer (all data is loaded from disc into the memory)\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-local-document.html":{"url":"rx-local-document.html","title":"LocalDocuments","keywords":"","body":"Local Documents\nLocal documents are a special class of documents which are used to store local metadata.\nThey come in handy when you want to store settings or additional data next to your documents.\n\nLocal Documents can exist on RxDatabase or RxCollection\nLocal Document do not have to match the collections schema\nLocal Documents do not get replicated\nLocal Documents will not be found on queries\nLocal Documents can not have attachments\nLocal Documents will not get handled by the data-migration\n\ninsertLocal()\nCreates a local document for the database or collection. Throws if a local document with the same id already exists. Returns a Promise which resolves the new RxLocalDocument.\nconst localDoc = await myCollection.insertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\n// you can also use local-documents on a database\nconst localDoc = await myDatabase.insertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\nupsertLocal()\nCreates a local document for the database or collection if not exists. Overwrites the if exists. Returns a Promise which resolves the RxLocalDocument.\nconst localDoc = await myCollection.upsertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\ngetLocal()\nFind a RxLocalDocument by it's id. Returns a Promise which resolves the RxLocalDocument or null if not exists.\nconst localDoc = await myCollection.getLocal('foobar');\n\nRxLocalDocument\nA RxLocalDocument behaves like a normal RxDocument.\nconst localDoc = await myCollection.getLocal('foobar');\n\n// access data\nconst foo = localDoc.get('foo');\n\n// change data\nlocalDoc.set('foo', 'bar2');\nawait localDoc.save();\n\n// observe data\nlocalDoc.get$('foo').subscribe(value => { /* .. */ });\n\n// remove it\nawait localDoc.remove();\n\nNOTICE: Because the local document does not have a schema, accessing the documents data-fields via pseudo-proxy will not work.\nconst foo = localDoc.foo; // undefined\nconst foo = localDoc.get('foo'); // works!\n\nlocalDoc.foo = 'bar'; // does not work!\nlocalDoc.set('foo', 'bar'); // works\n\n\nIf you are new to RxDB, you should continue here\n"},"custom-build.html":{"url":"custom-build.html","title":"Custom Build","keywords":"","body":"Custom Build\nBy default, if you import RxDB into your javascript, a full batteries-included build will be imported. This has the advantage that you don't have to choose which things you need and which not. The disadvantage is the build-size. Often you don't need most of the functionality and you could save a lot of bandwidth by cherry-picking only the things you really need. For this, RxDB supports custom builds.\nCore\nThe core-module is the part of RxDB which is always needed to provide basic functionality. If you need a custom build, you start with the core and then add all modules that you need.\n// es6-import\nimport RxDB from 'rxdb/plugins/core';\n\n// es5-require\nconst RxDB = require('rxdb/plugins/core');\n\nrequired modules\nSome parts of RxDB are not in the core, but are required. This means they must always be overwrite by at least one plugin.\nvalidate\nThe validation-module does the schema-validation when you insert or update a RxDocument. To use RxDB you always have to add a validation-module.\nThis one is using is-my-json-valid but you can also use your own validator instead. To import the default validation-module, do this:\n// es6-import\nimport RxDBValidateModule from 'rxdb/plugins/validate';\nRxDB.plugin(RxDBValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/validate'));\n\najv-validate\nAnother validation-module that does the schema-validation. This one is using ajv as validator which is a bit faster. Better compliant to the jsonschema-standart but also has a bigger build-size.\n// es6-import\nimport RxDBAjvValidateModule from 'rxdb/plugins/ajv-validate';\nRxDB.plugin(RxDBAjvValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/ajv-validate'));\n\nno-validate\nA validation module that does nothing at handles all data as valid. Use this as an alternative for the normal validator when you can rely on the input of the database.\nThis is meant for production to reduce the build-size, do not use this in dev-mode.\n// es6-import\nimport RxDBNoValidateModule from 'rxdb/plugins/no-validate';\nRxDB.plugin(RxDBNoValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/no-validate'));\n\noptional modules\nSome modules are optional and only needed if you use their functionality.\nerror-messages\nBecause error-messages are hard to compress, RxDB will throw error-codes by default. In development you should always include this plugin so full messages will be thrown.\n// es6-import\nimport RxDBErrorMessagesModule from 'rxdb/plugins/error-messages';\nRxDB.plugin(RxDBSchemaCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/error-messages'));\n\nschema-check\nThe schemacheck-module does additional checks on your jsonschema before you create a RxCollection. This ensure that your collection-schema is correctly working with rxdb. You should always enable this plugin on dev-mode.\n// es6-import\nimport RxDBSchemaCheckModule from 'rxdb/plugins/schema-check';\nRxDB.plugin(RxDBSchemaCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/schema-check'));\n\nreplication\nAdds the replication-functionality to RxDB.\n// es6-import\nimport RxDBReplicationModule from 'rxdb/plugins/replication';\nRxDB.plugin(RxDBReplicationModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/replication'));\n\nattachments\nAdds the attachments-functionality to RxDB.\n// es6-import\nimport RxDBAttachmentsModule from 'rxdb/plugins/attachments';\nRxDB.plugin(RxDBAttachmentsModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/attachments'));\n\nin-memory\nAdds the in-memory-replication to the collections.\n// es6-import\nimport RxDBInMemoryModule from 'rxdb/plugins/in-memory';\nRxDB.plugin(RxDBInMemoryModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/in-memory'));\n\nlocal-documents\nAdds the local-documents to the collections and databases.\n// es6-import\nimport RxDBLocalDocumentsModule from 'rxdb/plugins/local-documents';\nRxDB.plugin(RxDBLocalDocumentsModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/local-documents'));\n\njson-dump\nAdds the json import/export-functionality to RxDB.\n// es6-import\nimport RxDBJsonDumpModule from 'rxdb/plugins/json-dump';\nRxDB.plugin(RxDBJsonDumpModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/json-dump'));\n\nkey-compression\nThe keycompressor-module is needed when you have keyCompression enabled. This is done by default so make sure that you set disableKeyCompression to true when you do not have this module.\n// es6-import\nimport RxDBKeyCompressionModule from 'rxdb/plugins/key-compression';\nRxDB.plugin(RxDBKeyCompressionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/key-compression'));\n\nleader-election\nThe leaderelection-module is needed when want to use the leaderelection.\n// es6-import\nimport RxDBLeaderElectionModule from 'rxdb/plugins/leader-election';\nRxDB.plugin(RxDBLeaderElectionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/leader-election'));\n\nencryption\nThe encryption-module is using crypto-js and is only needed when you create your RxDB-Database with a password.\n// es6-import\nimport RxDBEncryptionModule from 'rxdb/plugins/encryption';\nRxDB.plugin(RxDBEncryptionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/encryption'));\n\nupdate\nThe update-module is only required when you use RxDocument.update or RxQuery.update.\n// es6-import\nimport RxDBUpdateModule from 'rxdb/plugins/update';\nRxDB.plugin(RxDBUpdateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/update'));\n\nadapter-check\nThis module add the checkAdapter-function to RxDB.\n// es6-import\nimport RxDBAdapterCheckModule from 'rxdb/plugins/adapter-check';\nRxDB.plugin(RxDBAdapterCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/adapter-check'));\n\n\nIf you are new to RxDB, you should continue here\n"},"plugins.html":{"url":"plugins.html","title":"Plugins","keywords":"","body":"Plugins\nCreating an own plugin is very simple. A plugin is basically an javascript-object which overwrites or extends RxDB's internal classes, prototypes and hooks.\nA basic plugins:\n\nconst myPlugin = {\n rxdb: true, // this must be true so rxdb knows that this is a rxdb-plugin and not a pouchdb-plugin\n /**\n * every value in this object can manipulate the prototype of the keynames class\n * You can manipulate every prototype in this list:\n * @link https://github.com/pubkey/rxdb/blob/cutsom-builds/src/Plugin.js\n */\n prototypes: {\n /**\n * add a function to RxCollection so you can call 'myCollection.hello()'\n *\n * @param {object} prototype of RxCollection\n */\n RxCollection: (proto) => {\n proto.hello = function(){\n return 'world';\n };\n }\n },\n /**\n * some methods are static and can be overwritten in the overwriteable-object\n */\n overwritable: {\n validatePassword: function(password) {\n if (password && typeof password !== 'string' || password.length \nProperties\nrxdb\nThe rxdb-property signals that this plugin is and rxdb-plugin and not a pouchdb-plugin. The value should always be true.\nprototypes\nThe prototypes-property contains a function for each of RxDB's internal prototype that you want to manipulate. Each function gets the prototype-object of the corresponding class as parameter and than can modify it. You can see a list of all available prototypes here\noverwritable\nSome of RxDB's functions are not inside of a class-prototype but are static. You can set and overwrite them with the overwritable-object. You can see a list of all overwriteables here.\nhooks\nSometimes you don't want to overwrite an existing RxDB-method, but extend it. You can do this by adding hooks which will be called each time the code jumps into the hooks corresponding call. You can find a list of all hooks here here.\noptions\nRxDatabase and RxCollection have an additional options-parameter, which can be filled with any data required be the plugin.\nconst collection = myDatabase.collection({\n name: 'foo'.\n schema: mySchema,\n options: { // anything can be passed into the options\n foo: ()=>'bar'\n }\n})\n\n// Afterwards you can use theses options in your plugin.\n\ncollection.options.foo(); // 'bar'\n\n\nIf you are new to RxDB, you should continue here\n"},"contribute.html":{"url":"contribute.html","title":"Contribute","keywords":"","body":"Contribution\nWe are open to, and grateful for, any contributions made by the community.\nDeveloping\nRequirements\nBefore you can start developing, do the following:\n\nMake sure you have installed nodejs with version 7 or higher\nClone the repository git clone https://github.com/pubkey/rxdb.git\nInstall the dependencies cd rxdb && npm install\nMake sure that the tests work for you npm run test\n\nFlow\nWhile developing you should run npm run dev and leave it open in the console. This will run the unit-tests on every file-change. If you have a slow device, you can also manually run npm run test:node every time you want to check if the tests work.\nAdding tests\nBefore you start creating a bugfix or a feature, you should create a test to reproduce it. Tests are in the test/unit-folder.\nIf you want to reproduce a bug, you can modify the test in this file.\nMaking a PR\nIf you make a pull-request, ensure the following:\n\nEvery feature or bugfix must be committed together with a unit-test which ensures everything works as expected.\nDo not commit build-files (anything in the dist-folder)\nBefore you add non-trivial changes, create an issue to discuss if this will be merged and you don't waste your time.\nTo run the unit and integration-tests, do npm run test and ensure everything works as expected\n\nGetting help\nIf you need help with your contribution, ask at gitter.\nDocs\nThe source of the documentation is at the docs-src-folder.\nTo read the docs locally, run npm run docs docs:install && npm run docs:serve and open http://localhost:4000/\nThank you for contributing!\n"}}} \ No newline at end of file +{"index":{"version":"0.5.12","fields":[{"name":"title","boost":10},{"name":"keywords","boost":15},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"./":[">","client","databas","first","here.","introduct","javascript.","new","offlin","reactive,","rxdb,","serverless,","side,","start"],"install.html":["\"dependencies\":","\"git+https://git@github.com/pubkey/rxdb.git#commithash\"","\"rxdb\":","'babel","'rxdb';","'rxjs';","'rxjs/add/operator/filter';","'rxjs/add/operator/first';","'rxjs/add/operator/map';","'rxjs/add/operator/mergemap';","'rxjs/operators/filter';","'rxjs/subject';","//","=","add","addit","altern","anoth","babel","before.","browsers.","build","cherri","code","commit.","commithash","continu","default","depend","develop","es5","es5.","es6","es8","file:","filter","full","git","hash","here","import","includ","instal","javascript","latest","lettabl","lib,","mean","need","new","npm","older","operators,","operators.","package.json,","package.json.","part","peer","pick","polyfil","polyfill');","polyfill';","polyfill.","polyfills,","reduc","releas","replac","requir","require('babel","require('rxdb');","require('rxjs');","run:","rxdb","rxdb,","rxdb.","rxj","rxjs'","save","size,","state","subject","support","transpil","us","var","want","whole","{","}"],"rx-database.html":["$","'heroesdb',","'localstorage');","'memdown';","'mydatabase',","'websql',","(optional)","(optional=false)","(optional=true)","*/).then(()",".create()",".then(()",".then(json","/*","//","12","4","=","=>","actual","ad","adapt","adapter,","adapter:","adapters.","add","affect","allow","app","app,","app.","assum","asynchron","at.","await","becom","befor","between","browsers,","call","case","chang","characters.","check","checkadapter()","cleanup","collect","common","console.dir(changeevent));","console.dir(json));","console.dir(ok);","console.log('done'));","const","contain","continu","cordova","cpu.","creat","creation","current","data","data.","databas","database,","database.","db","db1","db2","decrypt","defin","depend","destroy","destroy()","destroyed.","document.","done","dump","dump()","each","elect","electron","emptydatabase.importdump(json)","enabl","encrypt","environment.","equal","error","event","events.","exampl","explicitli","export","fals","field","folder","follow","free","function","function.","given","gone","handl","here","identifi","idl","idle.","ignoredupl","ignoreduplicate:","import","importdump()","instanc","instance.","instead","intent","isrxdatabas","it'","it.","javascript","json","leader.","level","leveldb","leveldb'));","localstorage'));","main","memdown","memdown});","memori","mistake,","module.","moment","more","ms","multiinst","multipl","mycollection.customcleanupfunction();","mydatabase.destroy();","mydatabase.dump()","mydatabase.dump(true)","mydatabase.remove();","mydatabase.requestidlepromise().then(()","mydatabase.requestidlepromise(1000","mydb.$.subscribe(changeev","name","name:","nativ","ness","new","nodej","not.","noth","notice:","now","object","observ","ok","on","other.","paramet","parameters.","pass","password","piec","pouchdb","prevent","process,","promis","rare","react","remov","remove()","replications.","requestidlecallback","requestidlepromise()","resolv","return","run","runtime,","rxdatabas","rxdatabase.","rxdb","rxdb,","rxdb.checkadapter('localstorage');","rxdb.create({","rxdb.create({name:","rxdb.isrxdatabase(myobj);","rxdb.plugin()","rxdb.plugin(require('pouchdb","rxdb.removedatabase('mydatabasename',","rxj","same","semi","serverless.","set","share","similar","singl","someth","speed","stop","storag","storage.","store","stream","string","synchronis","task","tasks.","tests,","this.","throw","time","timeout","track","true","true.","two","uniqu","unit","up","us","veri","waitforleadership()","want","window","without","work","wrong.","{","});"],"rx-schema.html":["\"array\",","\"birthyear\":","\"color\":","\"damage\":","\"describ","\"description\":","\"encrypted\":","\"final\":","\"healthpoints\":","\"hero","\"item\":","\"max\":","\"maxitems\":","\"min\":","\"name\":","\"number\"","\"number\",","\"object\",","\"primary\":","\"properties\":","\"required\":","\"secret\":","\"skills\":","\"string\"","\"string\",","\"title\":","\"type\":","\"uniqueitems\":","\"version\":","'heroes',","'human","'integer',","'lastname']","'object',","'string'","'string',","//","0","0,","0.","100","1900,","20","2050","5","5,","9]$","9_]*]?[a","=","[\"color\"]","['firstname',","^[a","`queri","accident","add","additionalproperti","advantages:","age:","allow","alway","anyth","anyway","array","attribut","attribute.","await","befor","between","birthyear","chang","change.","collect","collection.","color","compound","compoundindex","compression',","compression,","conform","console.dir(mydatabase.heroes.name);","const","contain","continu","creat","damag","data","database,","default","default:","defin","definit","definition.","detection`,","dev","disabl","disablekeycompress","disablekeycompression:","document","document,","document.","don't","done","enabl","encrypt","encrypted.","ensur","error","everyth","exampl","example,","false.","field","fieldnam","fieldnames,","fields.","fill","final","final,","final:","find","first","firstname:","follow","getter","greater","healthpoint","here","hero","hero\",","hero.","improv","index","index,","index:","indexed,","indexes,","insert","insid","instantli","integ","intern","invalid","it.","json","jsonschema","key","keycompress","lastname:","later.","learn","level","looks.","make","map","match","maximum","mean","migrationstrategi","modifi","mydatabase.collection({","myheroschema","myschema","name","name:","new","new.","notic","notice:","number","number,","object","observ","options.","pass","per","perform","popul","primary,","primary.","properti","properties:","provid","regex","requir","required.","required:","rxdb","rxdb,","rxschema","schema","schema\",","schema.","schema.org.","schema:","schemawithdefaultag","schemawithfinalag","schemawithindex","secondari","secret","set","settings:","simpl","singl","skill","spec","standard","start","store","string","string,","support","sure","team","temporari","therefor","things.","throw","title:","top","true","true,","true.","type","type:","unique,","unset","us","valid","valu","values.","version","version:","want","whenev","within","worry,","written","z0","z][[a","za","{","}","});","},","};"],"rx-collection.html":["$","'bar'","'bar2'","'bob'","'bob',","'foo',","'foo'}})","'heroes',","'humans',","'kelso'","'kelso';",".collection()",".exec().then(doc",".exec().then(docu",".then(()",".then(collect",".then(json",".upsert()","//","409","77;","9]*$.","=","==","=>",">","^[a","abov","allow","atom","atomicupsert()","automat","await","basic","befor","behavior","between","call","chain","chang","collect","collection'","collection,","collection.","collection2","collection2);","conflict","console.dir(changeevent));","console.dir(collection));","console.dir(doc));","console.dir(documents));","console.dir(json));","console.log('done'));","console.log(collect","const","continu","couchdb","creat","data","data.","databas","database,","database.","database:","db.collection({","db.heroes;","db['heroes']","decrypt","defin","destroy","destroy()","differ","directli","doc","docdata","document","document,","document.","documents,","documents.","does,","dump","dump()","easily.","encrypt","error.","errors,","especi","exec","exist","export","fals","field","fields.","fill","find","find()","findone()","finish","firstname:","follow","form","free","full","function","function.","generated.","given","handled.","help","here","here.","ident","identifi","import","importdump()","insert","insert()","instanc","instance.","isrxcollect","it.","javascript","json","known","last","lastname:","later","look","mani","match","mean","memori","method","method.","more","mycollection.$.subscribe(changeev","mycollection.atomicupsert(docdata);","mycollection.dump()","mycollection.dump(true)","mycollection.find().where('name').eq('foo')","mycollection.find({name:","mycollection.findone('foo')","mycollection.findone().where('name').eq('foo')","mycollection.importdump(json)","mycollection.insert({","mycollection.newdocument({","mycollection.remove();","mycollection.upsert(docdata);","mycollection.upsert({","mydatabase.collection({","mydatabase.destroy();","myschema","name","name.","name:","name:foobar","need","never","new","newdocument()","newli","not.","now","object","observ","older","oper","operations.","option","orm","otherwis","overwrit","overwritten","paramet","parrallel","pass","pouchdb","pouchset","prefil","prevent","previou","primari","primary,","property.","protocol.","queri","re","refind","regex:","remov","remove()","replic","replications.","return","run","running.","rxcollect","rxcollection.","rxcollection.newdocument(initaldata).","rxcollections,","rxdatabas","rxdb,","rxdb.isrxcollection(myobj);","rxdocument","rxdocument.","rxdocument.atomicupdate.","rxj","rxqueri","rxschema","rxschema.","same","save","schema","schema:","schemas,","schemaversions.","search","server","set","short","similar","simpl","singl","sometim","spawn","standard","still","stop","store","stream","support","sync","sync()","tempdoc","tempdoc.ag","tempdoc.lastnam","tempdoc.save();","temporari","through","throw","timespan,","transform","tri","true","two","type","type.","uniqu","until","up","updat","upsert","upsert()","us","valid","valu","veri","versions.","wait","want","within","work","z0","z][a","{","{$eq:","})","});","};"],"rx-document.html":["![synced.gif](files/synced.gif)","$","$inc:","$set:","'alice'","'bar'","'barfoo';","'foo',","'foobar'","'foobar');","'foobar';","'foobar2'","'foobar2');","'foobar2';","'name'","($)","(synced$","(via",".find()",".insert()",".save()",".subscribe(changeev",".subscribe(newnam","//","1","2","4","409","=","=>","[1,2,3,4].foreach(nr","```","```html","access","ad","ag","age:","alic","angular","anyth","argument,","atom","atomicupdate()","atomicupdate:","automat","await","b","base","befor","belong","boolean","browser","call","chang","changed.","changeev","changes.","click","collection'","collection,","collection.","compar","conflict","console.dir(changeevent));","console.dir(currentname);","console.dir(currentnestedvalue);","console.dir(documents));","console.dir(isname);","console.dir(mydocument.age);","console.log(laststate);","console.log(mydocument.deleted);","console.log(mydocument.firstname);","console.log(mydocument.get('firstname'));","console.log(mydocument.synced);","const","continu","current","currentnam","currentname;","currentnestedvalu","currentnestedvalue;","data","databas","database.","decrypt","delet","deleted$","deleted$.","depend","directli","directly.","doc.ag","document","document,","document.","dollarsign","each","edit","emit","encrypted,","error.","error:","errors,","event","exampl","fals","false),","field","fieldnam","find","finished.","fire","firstnam","fistname:","foobar","function","function.","get$","get$()","get()","getter","given","happen","here","ident","increas","insert","instanc","instead","isnam","isname;","isrxdocu","lastname:","lastpromis","lastpromise;","laststat","level","life","mani","mean","modifi","modifyjs.","mongo","more","mycollection.find().exec()","mycollection.insert({","mydocument.$()","mydocument.ag","mydocument.atomicupdate(function(doc){","mydocument.deleted$.subscribe(st","mydocument.firstnam","mydocument.firstname$","mydocument.get$('name')","mydocument.get('name');","mydocument.nam","mydocument.name;","mydocument.remove();","mydocument.resync();","mydocument.save();","mydocument.set('firstname',","mydocument.set('name',","mydocument.synced$.subscribe(st","mydocument.update({","mydocument.whatever.nestedfield","mydocument.whatever.nestedfield$","mydocument.whatever.nestedfield;","name","name.","name:","nest","nestedvalu","new","newname;","not.","note","notifi","now","nr;","null;","object","object,","observ","oper","operations.","overwrit","parameter.","path","prevent","previou","promis","proxi","record","relat","remov","remove()","reproduc","resync","resync()","return","returning.","run","running.","rxdb,","rxdb.isrxdocument(myobj);","rxdocument","rxdocument.","rxj","same","save","save()","save().","save,","set","set()","set).","short","show","singl","someon","state","state);","still","storag","store","submit","sync","synced$","synced$.","syntax,","tab","table.","take","throw","time","time.","timespan,","top","transform","true","two","type","updat","update()","us","usag","user","valu","value,","value.","values.","var","veri","warn","warning:","whether","wrap","{","}","});","},"],"rx-query.html":["$inc:",".where()","//","1","18","=","afterwards.","ag","age:","await","chain","chang","changed.","collect","collection.","console.dir(results);","const","continu","creat","database,","defin","delet","document","documents.","example:","fals","field.","find","found","function","given","heavi","here","immut","immutable.","increas","instanc","instead","isrxqueri","it,","keep","less","means,","mind","modifi","mycollection.find().where('age').gt(18);","mycollection.find().where('age').lt(18);","name","new","not.","notice:","now","object","object,","on","optimis","origin","over","perform","previou","promis","queri","queries.","query.remove();","query.update({","queryobject","queryobject.exec();","queryobject.sort('name');","queryobjectsort","queryobjectsort.exec();","reactiv","remov","remove()","removeddoc","resolv","result","result.","return","run","rxdb","rxdb,","rxdb.isrxquery(myobj);","rxdocument","rxqueri","rxquery'","rxquery.","sort","this,","time.","true","updat","update()","us","{","}","});"],"rx-attachment.html":["'cat.jpg'","'humans',","'image/jpeg'","'object',","(async)","(string)","(string|blob|buffer)",");",".","//","0,","=","=>","[];","ad","add","allattachments$","allattachments()","array","assign","attach","attachment'","attachment.","attachment.getdata();","attachment.getstringdata();","attachment.remove();","attachments,","attachments:","attributes/methods.","await","befor","better","binari","blob","blobbuff","buffer.","const","continu","data","data,","data.","db","digest","doc","document.","documents.","done.","each","emit","encrypt","encrypted:","ensur","exist.","files,","follow","get","getattachment()","getdata()","getstringdata()","here","higher","id","id,","id.","imag","length","limit","md5","mycollect","mydatabase.collection({","mydocument.allattachments$.subscribe(","mydocument.allattachments();","mydocument.getattachment('cat.jpg');","mydocument.putattachment({","myschema","name","name:","new","null","number","number.","object","observ","password","perform","pouchdb,","promis","properties:","putattachment()","quota","re","regular","remov","remove()","repres","resolv","return","rev","revis","rxattach","rxcollection.","rxdb","rxdb,","rxdocument","rxdocument.","schema","schema:","set","side","store","stream","string","string,","string.","sum","time","to.","true","true,","type","type:","us","version:","want","whatev","{","}","});","},","};"],"middleware.html":["'anyvalue';","'foobar'","'foobar',","'myfield',","()","(also","//","100));","=","=>","action","add","alreadi","another.","async","asynchron","asynchronous.","atom","avoid","await","befor","behavior","block","cach","call","case","certain","chang","clear","code.","collection.","complex","console.log(doc.myfield);","const","constructed.","continu","control","creat","custom","data","databas","database.","default","defin","delet","depend","differ","doc","doc.anyfield","document","document.","documents.","dure","emit","error('stop');","error.","event","execut","false);","field","field,","flexibl","follow","function","functions.","get:","getter/sett","happen","help","here","hook","hook,","hook?","hooks)","hooks:","ideas:","insert","instanc","interact","lastnam","level","lifecycl","list","logic","make","mean","middlewar","model","modifi","mongoose,","mongoose.","mycollection.findone().exec();","mycollection.postcreate(function(doc){","mycollection.postinsert(function(documentdata){","mycollection.postremove(function(doc){","mycollection.postsave(function(doc){","mycollection.preinsert(function(documentdata){","mycollection.preremove(function(doc){","mycollection.presave(function(doc){","nest","new","notice:","notif","object","object.defineproperty(doc,","on","oper","parallel","pass","post","postcreat","postinsert","postremov","postsav","pre","preinsert","preremov","presav","promise(r","promise.","receiv","remov","removed.","return","run","rxcollect","rxcollection.insert","rxdatabas","rxdb","rxdb,","rxdocument","rxdocument,","rxdocument.remov","rxdocument.sav","save","saved.","schema","seri","set","settimeout(res,","specif","specifi","stop","structur","support","sure","synchron","task","therefor","throw","trigger","true);","updat","us","usag","valid","valu","way","whenev","whole","written","{","});","},"],"orm.html":["'","'!!';","'aaah!!'","'aaah!!';","'cat.txt',","'heroes'","'heroes',","'i","'meow","'skeletor'","'text/plain'","+","//","=","add","attach","attachments:","await","behavior","call","capabl","collect","collection.","collection:","collections.","console.log(attachment.scream());","console.log(doc.scream());","console.log(doc.whoami());","console.log(heroes.scream());","console.log(heroes.whoami());","const","contain","continu","creat","data","data:","defin","doc","doc.putattachment({","document","function","function(){","functions,","here","hero","heroes.findone().exec();","heroes.insert({","id:","instanc","keyword","keyword:","kitty',","map","method","methods:","mongoose,","mydatabase.collection({","myschema,","name:","names.","new","object","orm","orm/drm","pass","relat","resolv","return","rxattachemnt","rxdb","rxdb,","rxdocument","schema:","scream:","skeletor!!'","specif","static","statics:","this.nam","this.name;","type:","us","whoami:","wide","wide.","{","}","});"],"population.html":["'alice'","'alice',","'array',","'bob',","'carol'","'carol',","'dave'","'human","'human'","'human',","'object',","'string'","'string',","(primari","//","//>","//[insert","0,","=","[","]","_","add","alway","anoth","array","array.","attribut","await","belong","bestfriend","bestfriend:","collect","collections.","come","console.dir(bestfriend);","console.dir(friends);","console.dir(mother);","const","continu","database.","describ","direct","doc","doc.bestfriend_;","doc.populate('bestfriend');","document","exactli","exampl","export","family:","field","fieldname.","foreign","found.","friend","friends:","getter","getter.","here","here]","human","human',","humanscollection.findone('alice').exec();","humanscollection.findone('bob').exec();","humanscollection.insert({","in.","items:","join","keyword","method","method.","mongoose.","mother","mother:","mycollect","mycollection.insert({","mydatabase.collection({","mydocument.family.mother_;","mydocument.friends_;","name:","nest","new","notic","null","on","path","popul","populate()","primary:","promis","properties:","ref","ref:","refer","referenc","refhuman","relat","resolv","return","rxcollect","rxdb","rxdb,","rxdocument","rxdocument)","rxdocument,","rxdocument[alice]","same","schema","schema:","sometim","specifi","still","string","suffix","take","therefor","title:","to.","true,","type:","underscor","underscore_","us","valu","values.","version:","via","want","work","{","}","});","},","};"],"data-migration.html":["'bi","'messages',","'sendercountry'","(or","(string)","(version:",");","*","*/",".migratepromise():",".then(respons","/**","//","0","0,","0.","02","1","12","12t23:03:05+00:00","1486940585","1:","2","2)","2017","2:","50,","=","=>","accomplish","add","alreadi","alway","amount","app","appear","assigned.","assur","asynchron","automat","automigr","automigrate:","await","awesom","bar.","better","call)","chang","client'","code","collect","collection,","collection.","combin","compar","console.dir(state),","console.error(error),","console.log('done')","const","continu","coordin","countri","created.","creation","data","data.","datamigr","date","date(olddoc.time).gettime();","dates.","decid","default,","defin","delet","deleted:","devic","distribut","doc","document","don't","done","done:","easier","emit","error","exist","false,","fetch('http://myserver.com/api/countrybycoordinates/'+coordinates+'/')","field","filter","finish","function","function(olddoc){","get","greater","hand'","handl","handled:","happen","here","hint","if(olddoc.tim","imagin","incom","increas","instead","leaderelect","load","long","look","lot","make","mani","match","means,","messag","messagecol","messagecol.migratepromise(10);","messages.","messageschemav1,","messeng","migrat","migrated.","migrated:","migratepromise;","migrationpromis","migrationstrategi","migrationstrategies:","mydatabase.collection({","name:","new","new,","newer","newest","null,","number","object","old","olddoc.coordinates;","olddoc.sendercountry=response;","olddoc.tim","olddoc;","older","on","open","paramet","percent:","percentag","problem","promis","properti","provid","remains:","remov","requir","resolv","resourc","respons","response.json();","return","run","rxdb","rxdb,","save","schema","schema'","schema:","schema?","schemas.","sender","server","show","start","state","strategi","string","succeed","success:","sure","tabs.","take","this,","this:","time,","timestamp","total:","transform","true","unix","upon","us","used:","user","user'","user,","users'","users.","version","version,","version.","want","wast","while,","{","}","});","},"],"leader-election.html":["'dies'.","'localstorage',","'mypassword',","'temperature',","'weatherdb',","*",".then(()","//","10","10);","1000","5","6*5=30","=","=>","access.","adapter:","algorithm","alway","api","await","becom","befor","between","browser","build,","case","charts,","check","client","closed,","closed.","code","collection.","conflict","connections.","console.log('long","const","continu","corner.","count","crown","current","data","data,","date().gettime()","db","db.collection({","db.temperature.insert({","db.waitforleadership()","degrees:","device,","display","easy,","elect","exact","exactli","exampl","fetch('https://example.com/api/temp/');","hand","heatmaps.","here","imagin","implement","inspect","king!');","lead","leader","leader,","leader.","leaderelect","live","locat","make","manag","mani","mark","matter","messag","minute.","moment","more","multiinstance:","myschema","name:","new","now","number","old","on","once.","open","out","over","password:","per","pleas","polling.","power","produce,","pull","read","reassign","redund","remot","resourc","right","run","rxdb","rxdb,","rxdb.create({","same","save","schema:","second","seconds.","see","send","sent","server","site","solut","solv","start","stay","sure","system","tab","tab.","tabs,","temp","temp,","temperatur","ten","them,","these","thing","this,","time","time:","top","traffic","tri","true","until","us","usag","vanillaj","variou","visitor","wait..","wast","way","websit","websocket","wire","you.","{","});","},","♛"],"replication.html":["'http://localhost:10102/db/',","(default)","(optional)","(remot",");","//","=","=>","[default=true]","active$","adapt","add","anoth","async","await","basic","call","cancel","cancel()","chang","change$","collect","complete$","complete.","completed.","completes.","connect","console.dir(active));","console.dir(change));","console.dir(completed));","console.dir(docdata));","console.dir(error));","const","continu","couchdb,","data.","database)","database.","db.","default=tru","depend","dies,","direct","direction:","docs$","document","dure","each","emit","enabl","error","error$","event","exampl","fals","featur","handler","here","here.","http","http'));","https://pouchdb.com/api.html#repl","instanc","instance,","intern","leader","live:","make","match","method","mycollection.find().where('age').gt(18)","mycollection.sync(","need","never","new","observ","occur","on","option","options:","over","performance,","plugin","pouch/couch","pouchdb","power","pull:","push:","queri","query:","recogn","reestablished.","remot","remote:","replic","replicated.","replication,","replication.","replicationst","replicationstate.active$.subscribe(act","replicationstate.cancel();","replicationstate.change$.subscribe(chang","replicationstate.complete$.subscribe(complet","replicationstate.docs$.subscribe(docdata","replicationstate.error$.subscribe(error","retry:","return","running.","rx.collection.sync()","rxcollect","rxcollection,","rxcollection.sync()","rxcollection.sync().","rxdb","rxdb,","rxdb.plugin(require('pouchdb","rxj","rxreplicationst","same","save","server","serverurl,","specifi","start","stream.","sure","sync","sync.","synchronis","time","true","true,","until","us","via","waitforleadership:","{","},"],"query-change-detection.html":["'');","'',","'rxdb';","+",".exec()'",".reduce((prev,","//","=","=>","again.","anyuser.loggedin","anyuser.save();","await","beta","big","calcul","call","case","collect","collection.","console.log","const","continu","cost.","creat","cur)","cur.username+","current","databas","default.","detect,","disabl","display","document.queryselector('body').innerhtml","documents,","documents.","done","driver,","enabl","enable()","enabled.","engine.","events.","everytim","exampl","false;","function","gain","here","huge","imagin","import","in.","io","it.","log","long","made","make","mani","memori","meteor","module.","multipl","new","notice:","now,","observ","off,","on","oplog","optim","optimis","over","page","perform","plu","point","prev","queri","queries,","queries.","query.","query.$.subscribe(us","querychangedetect","querychangedetector","querychangedetector.enable();","querychangedetector.enabledebugging();","re","realli","request","result","reus","run","rxchangeevent.","rxdb","rxdb,","same","show","similar","storag","subscrib","sure","take","then,","thousand","time","toplist","update/insert/remov","us","user","userscollection.find().where('loggedin').eq(true).sort('points');","veri","want","whole","without","work","zero","{","}","});"],"in-memory.html":["'npm","'pouchdb","(all","//","=","adapt","add","amount","anoth","attach","automat","await","befor","behav","both.","chang","collect","collection.","computer.","cons:","const","continu","creation","data","decrypt","disc","doc","document","encrypt","enough","equal","event","faster","field","fields.","fire","fit","heavi","here","import","important:","initi","inmemori","insid","instal","it'","load","longer","mean","memcol","memcol.find().exec();","memori","memory';","memory)","mycollect","mycollection.inmemory();","new","now","on","oper","optim","origin","over","parent","pouchadaptermemori","pouchdb","promis","pros:","queri","ram","replic","resolv","result","return","run","rxcollect","rxcollection().inmemory();","rxcollection,","rxdb,","rxdb.plugin(pouchadaptermemory);","same","save'","share","small","store","stream.","support","take","them,","two","u","updat","us","version","want","way","work","write"],"rx-local-document.html":["'bar'","'bar');","'bar';","'bar2');","'foobar',",");","*/","..","/*","//","=","=>","access","addit","alreadi","attach","await","behav","chang","class","collect","collection.","come","const","continu","creat","data","databas","document","documents.","exist","exists.","field","find","foo","foo:","found","getlocal()","handi","handl","here","id","id.","insertlocal()","it'","local","localdoc","localdoc.foo","localdoc.foo;","localdoc.get$('foo').subscribe(valu","localdoc.get('foo');","localdoc.remove();","localdoc.save();","localdoc.set('foo',","localdocu","match","metadata.","migrat","mycollection.getlocal('foobar');","mycollection.insertlocal(","mycollection.upsertlocal(","mydatabase.insertlocal(","new","next","normal","notice:","null","observ","overwrit","promis","proxi","pseudo","queri","remov","replic","resolv","return","rxcollect","rxdatabas","rxdb,","rxdocument.","rxlocaldocu","rxlocaldocument.","same","schema","schema,","set","special","store","throw","undefin","upsertlocal()","us","via","want","work","work!","work.","works!","{","}","});"],"custom-build.html":["'rxdb/plugins/adapt","'rxdb/plugins/ajv","'rxdb/plugins/attachments';","'rxdb/plugins/core';","'rxdb/plugins/encryption';","'rxdb/plugins/error","'rxdb/plugins/in","'rxdb/plugins/json","'rxdb/plugins/key","'rxdb/plugins/lead","'rxdb/plugins/loc","'rxdb/plugins/no","'rxdb/plugins/replication';","'rxdb/plugins/schema","'rxdb/plugins/update';","'rxdb/plugins/validate';","//","=","adapt","add","addit","advantag","ajv","altern","alway","anoth","attach","bandwidth","basic","batteri","befor","better","bigger","bit","build","build,","builds.","check","check'));","check';","checkadapt","cherri","choos","code","collect","collections.","compliant","compress","compress,","compression'));","compression';","const","continu","core","core,","correctli","creat","crypto","custom","data","databas","database.","databases.","default","default,","default.","dev","develop","disablekeycompress","disadvantag","document","documents'));","documents';","don't","done","dump","dump'));","dump';","elect","election'));","election';","enabl","enabled.","encrypt","ensur","error","es5","es6","faster.","full","function","functionality.","handl","hard","here","import","import/export","imported.","includ","input","insert","instead.","javascript,","js","json","jsonschema","key","keycompress","keycompressor","leader","leaderelect","leaderelection.","local","lot","make","mean","meant","memori","memory'));","memory';","messag","messages'));","messages';","mode.","modul","module,","module.","need","need.","new","normal","not.","noth","on","option","overwrit","part","password.","pick","plugin","plugin.","product","provid","realli","reduc","reli","replic","requir","require('rxdb/plugins/core');","required.","rxcollection.","rxdb","rxdb,","rxdb.","rxdb.plugin(require('rxdb/plugins/adapt","rxdb.plugin(require('rxdb/plugins/ajv","rxdb.plugin(require('rxdb/plugins/attachments'));","rxdb.plugin(require('rxdb/plugins/encryption'));","rxdb.plugin(require('rxdb/plugins/error","rxdb.plugin(require('rxdb/plugins/in","rxdb.plugin(require('rxdb/plugins/json","rxdb.plugin(require('rxdb/plugins/key","rxdb.plugin(require('rxdb/plugins/lead","rxdb.plugin(require('rxdb/plugins/loc","rxdb.plugin(require('rxdb/plugins/no","rxdb.plugin(require('rxdb/plugins/replication'));","rxdb.plugin(require('rxdb/plugins/schema","rxdb.plugin(require('rxdb/plugins/update'));","rxdb.plugin(require('rxdb/plugins/validate'));","rxdb.plugin(rxdbadaptercheckmodule);","rxdb.plugin(rxdbajvvalidatemodule);","rxdb.plugin(rxdbattachmentsmodule);","rxdb.plugin(rxdbencryptionmodule);","rxdb.plugin(rxdbinmemorymodule);","rxdb.plugin(rxdbjsondumpmodule);","rxdb.plugin(rxdbkeycompressionmodule);","rxdb.plugin(rxdbleaderelectionmodule);","rxdb.plugin(rxdblocaldocumentsmodule);","rxdb.plugin(rxdbnovalidatemodule);","rxdb.plugin(rxdbreplicationmodule);","rxdb.plugin(rxdbschemacheckmodule);","rxdb.plugin(rxdbupdatemodule);","rxdb.plugin(rxdbvalidatemodule);","rxdbadaptercheckmodul","rxdbajvvalidatemodul","rxdbattachmentsmodul","rxdbencryptionmodul","rxdberrormessagesmodul","rxdbinmemorymodul","rxdbjsondumpmodul","rxdbkeycompressionmodul","rxdbleaderelectionmodul","rxdblocaldocumentsmodul","rxdbnovalidatemodul","rxdbreplicationmodul","rxdbschemacheckmodul","rxdbupdatemodul","rxdbvalidatemodul","rxdocument.","rxdocument.upd","rxquery.update.","save","schema","schemacheck","set","size,","size.","standart","start","support","sure","thing","this,","this:","throw","thrown.","true","updat","us","valid","valid.","validate'));","validate';","validation.","want","work"],"plugins.html":["!==","&&","'bar'","'foo'.","'mycollection.hello()'","'string'","'world';","()=>'bar'","(password","(proto)","*","*/","/**","//","=","=>","@link","@param","ad","add","addit","afterward","alway","anyth","avail","basic","builds/src/plugin.j","call","call.","class","classes,","code","collect","collection.options.foo();","const","contain","continu","correspond","creat","data","don't","each","exist","extend","fill","find","foo:","function","function(){","function(password)","get","here","here.","hook","hooks.","https://github.com/pubkey/rxdb/blob/cutsom","insid","intern","it.","javascript","jump","keynam","know","list","list:","manipul","manipulate.","method","method,","modifi","mydatabase.collection({","myplugin","myschema,","name:","new","object","object.","option","options:","overwrit","overwritable:","overwritten","paramet","parameter,","pass","password","password.length","plugin","plugin.","plugins:","pouchdb","properti","proto.hello","prototyp","prototypes:","requir","return","rxcollect","rxcollection:","rxdatabas","rxdb","rxdb'","rxdb,","rxdb:","schema:","see","set","signal","simple.","sometim","static","static.","these","time","true","true,","true.","typeof","us","validatepassword:","valu","veri","want","{","{object}","||","}","})","},","};"],"contribute.html":["&&","(anyth","7","ad","add","ask","befor","bug,","bugfix","build","cd","change.","changes,","check","clone","commit","community.","console.","contribut","contributing!","contribution,","creat","depend","dev","develop","developing,","device,","discuss","dist","doc","docs:instal","docs:serv","document","don't","ensur","everyth","expect","expected.","featur","feature,","file","file.","flow","folder)","folder.","following:","for,","get","git","gitter.","grate","help","higher","http://localhost:4000/","https://github.com/pubkey/rxdb.git","instal","integr","issu","it.","leav","locally,","made","make","manual","merg","modifi","need","nodej","non","npm","open","pr","pull","read","repositori","reproduc","request,","requir","run","rxdb","slow","sourc","src","start","sure","test","test/unit","test:nod","tests,","thank","time","time.","to,","togeth","trivial","unit","version","want","wast","work","work."]},"length":20},"tokenStore":{"root":{"0":{"2":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.014705882352941176},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010344827586206896},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"1":{"0":{"0":{"0":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},")":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}},"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"2":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"t":{"2":{"3":{"docs":{},":":{"0":{"3":{"docs":{},":":{"0":{"5":{"docs":{},"+":{"0":{"0":{"docs":{},":":{"0":{"0":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"4":{"8":{"6":{"9":{"4":{"0":{"5":{"8":{"5":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"8":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"9":{"0":{"0":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"docs":{}},"docs":{}},"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}},"2":{"0":{"1":{"7":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},"docs":{}},"5":{"0":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"docs":{}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}},"4":{"0":{"9":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},"docs":{}},"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"5":{"0":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"6":{"docs":{},"*":{"5":{"docs":{},"=":{"3":{"0":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"docs":{}},"docs":{}}},"docs":{}}},"7":{"7":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"9":{"docs":{},"]":{"docs":{},"$":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"*":{"docs":{},"$":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"_":{"docs":{},"]":{"docs":{},"*":{"docs":{},"]":{"docs":{},"?":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"docs":{},">":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}},"c":{"docs":{},"l":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"c":{"docs":{},"k":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"n":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"d":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"e":{"docs":{},"v":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"s":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"t":{"docs":{},"s":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"i":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"o":{"docs":{},"o":{"docs":{},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}}}}},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"t":{"docs":{},"e":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"s":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}},"e":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":10.012422360248447}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"!":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"o":{"docs":{},"n":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}},"o":{"docs":{},"k":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}}}}}}}}}},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"(":{"docs":{},"'":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}}}}}}}}}}}},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"m":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"o":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"o":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01694915254237288},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.05063291139240506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.046218487394957986},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.041474654377880185},"population.html":{"ref":"population.html","tf":0.034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.03686635944700461},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"n":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.036016949152542374},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006896551724137931},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.04054054054054054},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"o":{"docs":{},"n":{"2":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},"s":{"docs":{},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"r":{"docs":{},"d":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"e":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"n":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"r":{"docs":{},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"s":{"docs":{},"t":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"c":{"docs":{},"u":{"docs":{},"l":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}}},"s":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"c":{"docs":{},"h":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"p":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}}}}},"p":{"docs":{},"u":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}},")":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},".":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"+":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"custom-build.html":{"ref":"custom-build.html","tf":5.006550218340611}}}}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"d":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.012711864406779662},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.03361344537815126},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.041474654377880185},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-database.html":{"ref":"rx-database.html","tf":0.031026252983293555},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"s":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":10.00257731958763}}}}}}},"e":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"(":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"=":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"i":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"p":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"i":{"docs":{},"c":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"i":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"y":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"t":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"`":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"b":{"1":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"2":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"i":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}},"[":{"docs":{},"'":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},"]":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"population.html":{"ref":"population.html","tf":0.010344827586206896},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.024844720496894408}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.02754237288135593},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"rx-query.html":{"ref":"rx-query.html","tf":0.0379746835443038},"middleware.html":{"ref":"middleware.html","tf":0.018140589569160998},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.010344827586206896},"data-migration.html":{"ref":"data-migration.html","tf":0.01804123711340206},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06912442396313365},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"o":{"docs":{},"d":{"docs":{},"y":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"n":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}}}}}},"s":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},":":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"n":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"'":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"r":{"docs":{},"e":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"i":{"docs":{},"s":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"c":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"u":{"docs":{},"s":{"docs":{},"s":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.009345794392523364}},"l":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}},"y":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"r":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"l":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"s":{"docs":{},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.03361344537815126},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006896551724137931},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"t":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}},"s":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},"(":{"docs":{},")":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},")":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},")":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.034013605442176874}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},")":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}}}}}},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},":":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"s":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"o":{"docs":{},"w":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"e":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"(":{"docs":{},"'":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"m":{"docs":{},"y":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"b":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"/":{"docs":{},"'":{"docs":{},"+":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"+":{"docs":{},"'":{"docs":{},"/":{"docs":{},"'":{"docs":{},")":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"/":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"/":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},".":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},"o":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788}},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"v":{"docs":{},"i":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"t":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"l":{"docs":{},"p":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"i":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}}}},"r":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"n":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"o":{"docs":{},"o":{"docs":{},"k":{"docs":{"middleware.html":{"ref":"middleware.html","tf":5.054421768707483},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"?":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"s":{"docs":{},")":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}},"'":{"docs":{},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}}}}}}}},"b":{"docs":{},"o":{"docs":{},"b":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"population.html":{"ref":"population.html","tf":0.013793103448275862}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},".":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"#":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"p":{"docs":{},"u":{"docs":{},"b":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"/":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"/":{"docs":{},"c":{"docs":{},"u":{"docs":{},"t":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},":":{"4":{"0":{"0":{"0":{"docs":{},"/":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":10}}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},"r":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"r":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"c":{"docs":{},"l":{"docs":{},"u":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"o":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":10.030674846625766},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}},"n":{"docs":{},"c":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}},"e":{"docs":{},"d":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"s":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":10.006756756756756}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.07975460122699386},"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.07423580786026202}},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"/":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"r":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}},"a":{"docs":{},"g":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"i":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"d":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"a":{"docs":{},"s":{"docs":{},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}},"g":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}}}}}}}}}}},"s":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"s":{"docs":{},"u":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"t":{"docs":{},"'":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"f":{"docs":{},"(":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"o":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"j":{"docs":{},"a":{"docs":{},"v":{"docs":{},"a":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"s":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.027210884353741496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"s":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"e":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.017467248908296942},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"s":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006896551724137931}},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"x":{"docs":{},"t":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"p":{"docs":{},"m":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"contribute.html":{"ref":"contribute.html","tf":0.043478260869565216}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.027649769585253458},"population.html":{"ref":"population.html","tf":0.034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"s":{"docs":{},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"j":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"i":{"docs":{},"c":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"f":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"n":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}}},"l":{"docs":{},"l":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"r":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}},"l":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"=":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.04048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}}},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"m":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"i":{"docs":{},"s":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"c":{"docs":{},"e":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"/":{"docs":{},"d":{"docs":{},"r":{"docs":{},"m":{"docs":{"orm.html":{"ref":"orm.html","tf":10}}}}}}},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"in-memory.html":{"ref":"in-memory.html","tf":0.033783783783783786}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},"w":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.03211009174311927}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}},"c":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"r":{"docs":{},"e":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"i":{"docs":{},"v":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"e":{"docs":{},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}}}}},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"a":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.006896551724137931}}}},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"i":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":10.032710280373832},"in-memory.html":{"ref":"in-memory.html","tf":0.033783783783783786},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"s":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}},"e":{"docs":{},"s":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.039301310043668124},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"b":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}},"d":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"i":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.014018691588785047}},"e":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.03164556962025317},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"e":{"docs":{},".":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.014830508474576272},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.02531645569620253},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.029411764705882353},"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.020618556701030927},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"r":{"docs":{},"y":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"g":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"f":{"docs":{"population.html":{"ref":"population.html","tf":0.010344827586206896}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.010344827586206896}}},"e":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.013793103448275862}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"h":{"docs":{},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"g":{"docs":{},"n":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}},"v":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"i":{"docs":{},"s":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{"install.html":{"ref":"install.html","tf":0.03680981595092025},"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.019650655021834062},"plugins.html":{"ref":"plugins.html","tf":0.027522935779816515},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"'":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},"m":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"o":{"docs":{},"c":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"n":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"v":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"m":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"j":{"docs":{},"v":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":10.011933174224344},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":10.012704174228675},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"population.html":{"ref":"population.html","tf":0.013793103448275862}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},")":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},"[":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}}}}}}}}}}}}},"j":{"docs":{"install.html":{"ref":"install.html","tf":0.03067484662576687},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"s":{"docs":{},"'":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":10.002100840336135},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":10.002118644067796},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-query.html":{"ref":"rx-query.html","tf":10.031645569620252}}},"y":{"docs":{},"'":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.0189873417721519}}},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":10.012605042016807}},"e":{"docs":{},"m":{"docs":{},"n":{"docs":{},"t":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.06832298136645963}},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"m":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"u":{"docs":{},"r":{"docs":{},"l":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.02947845804988662}}}},"m":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"m":{"docs":{},"e":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}}}}}}}}}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}},")":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"s":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"n":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}},",":{"docs":{"./":{"ref":"./","tf":0.07692307692307693}}}}},"z":{"docs":{},"e":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"p":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"e":{"docs":{},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}},"t":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"./":{"ref":"./","tf":0.07692307692307693},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"t":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"i":{"docs":{},"c":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"s":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"n":{"docs":{},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"y":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"o":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"d":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"'":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"population.html":{"ref":"population.html","tf":0.006896551724137931},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"u":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}}}}}},"p":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"r":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"m":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"s":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"w":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"i":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"o":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}},"r":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"v":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"c":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},"i":{"docs":{},"f":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"a":{"docs":{},"w":{"docs":{},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"replication.html":{"ref":"replication.html","tf":0.04205607476635514}},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},".":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0273109243697479},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.008733624454148471}},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815}},"o":{"docs":{},"r":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006896551724137931},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"?":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"m":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}},"k":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"r":{"docs":{},"c":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"\"":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"+":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"@":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"p":{"docs":{},"u":{"docs":{},"b":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"/":{"docs":{},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"#":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"\"":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"\"":{"docs":{},":":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"y":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"\"":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"k":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.02100840336134454}}}}}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"b":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"r":{"2":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}},"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.010344827586206896}}}}}},"i":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"r":{"docs":{},"x":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}},"i":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"o":{"docs":{},"c":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"n":{"docs":{},"o":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}},"j":{"docs":{},"s":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"/":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"/":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"/":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"/":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"'":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"e":{"docs":{},"s":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206}}}}}},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"orm.html":{"ref":"orm.html","tf":0.02304147465437788}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"s":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.013793103448275862}}}}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},":":{"1":{"0":{"1":{"0":{"2":{"docs":{},"/":{"docs":{},"d":{"docs":{},"b":{"docs":{},"/":{"docs":{},"'":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},"]":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"'":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"w":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}}}}}}}}},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"'":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"(":{"docs":{},")":{"docs":{},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"e":{"docs":{},"b":{"docs":{},"s":{"docs":{},"q":{"docs":{},"l":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"b":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{},"'":{"docs":{},";":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"i":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"/":{"docs":{},"j":{"docs":{},"p":{"docs":{},"e":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010344827586206896}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.012605042016806723},"population.html":{"ref":"population.html","tf":0.017241379310344827},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"}":{"docs":{},"}":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"b":{"docs":{},"a":{"docs":{},"r":{"2":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}},"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.009074410163339383}}},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"'":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.006896551724137931}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.010344827586206896}}}}}}}},"n":{"docs":{},"y":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"'":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}},"a":{"docs":{},"a":{"docs":{},"h":{"docs":{},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.013824884792626729}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"'":{"docs":{},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"p":{"docs":{},"m":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},".":{"docs":{},"j":{"docs":{},"p":{"docs":{},"g":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"t":{"docs":{},"x":{"docs":{},"t":{"docs":{},"'":{"docs":{},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}},",":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}},"!":{"docs":{},"!":{"docs":{},"'":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"'":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"'":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"'":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}},"'":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"p":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}},"/":{"docs":{},"/":{"docs":{"install.html":{"ref":"install.html","tf":0.05521472392638037},"rx-database.html":{"ref":"rx-database.html","tf":0.028639618138424822},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.036016949152542374},"rx-document.html":{"ref":"rx-document.html","tf":0.05263157894736842},"rx-query.html":{"ref":"rx-query.html","tf":0.0379746835443038},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.029411764705882353},"middleware.html":{"ref":"middleware.html","tf":0.049886621315192746},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.010344827586206896},"data-migration.html":{"ref":"data-migration.html","tf":0.03865979381443299},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.04672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06912442396313365},"custom-build.html":{"ref":"custom-build.html","tf":0.06986899563318777},"plugins.html":{"ref":"plugins.html","tf":0.01834862385321101}},">":{"docs":{"population.html":{"ref":"population.html","tf":0.013793103448275862}}},"[":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}},"*":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"*":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}}}},"=":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-collection.html":{"ref":"rx-collection.html","tf":0.0211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.043557168784029036},"rx-query.html":{"ref":"rx-query.html","tf":0.05063291139240506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.05042016806722689},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.041474654377880185},"population.html":{"ref":"population.html","tf":0.034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.01804123711340206},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.041474654377880185},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},">":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.014319809069212411},"rx-collection.html":{"ref":"rx-collection.html","tf":0.019067796610169493},"rx-document.html":{"ref":"rx-document.html","tf":0.014519056261343012},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"=":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"a":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"orm.html":{"ref":"orm.html","tf":0.018433179723502304},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.017467248908296942},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"i":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.02386634844868735},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206}}},":":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"$":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"custom-build.html":{"ref":"custom-build.html","tf":0.010917030567685589},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"i":{"docs":{},"c":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}},"g":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"m":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"population.html":{"ref":"population.html","tf":0.006896551724137931},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"w":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}},"g":{"docs":{},"u":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"v":{"docs":{},"e":{"docs":{},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"c":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"s":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"i":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.015873015873015872},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}},"k":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"e":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},"s":{"docs":{},"/":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.10504201680672269},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"'":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}},"s":{"docs":{},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},":":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.016706443914081145},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.012711864406779662},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"rx-query.html":{"ref":"rx-query.html","tf":0.02531645569620253},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.025210084033613446},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.04608294930875576},"population.html":{"ref":"population.html","tf":0.04827586206896552},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.03225806451612903}}}}},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"b":{"docs":{},"o":{"docs":{},"v":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}},"j":{"docs":{},"v":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"b":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}}}},"s":{"docs":{},"i":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},"r":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"n":{"docs":{},"d":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"e":{"docs":{},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"t":{"docs":{},"w":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"a":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"h":{"docs":{},"a":{"docs":{},"v":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"i":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.017241379310344827}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},"s":{"docs":{},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":5.010917030567685},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"s":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"/":{"docs":{},"s":{"docs":{},"r":{"docs":{},"c":{"docs":{},"/":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},".":{"docs":{},"j":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"g":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}}}}},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"y":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"t":{"docs":{},"h":{"docs":{},".":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}},"b":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"c":{"docs":{},"k":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"e":{"docs":{},"s":{"5":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"custom-build.html":{"ref":"custom-build.html","tf":0.034934497816593885}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"6":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"custom-build.html":{"ref":"custom-build.html","tf":0.034934497816593885}}},"8":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}},"docs":{},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}}},"s":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"e":{"docs":{},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"y":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.02336448598130841}}}}},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}},"d":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"c":{"docs":{},"r":{"docs":{},"y":{"docs":{},"p":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"in-memory.html":{"ref":"in-memory.html","tf":0.02702702702702703},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},":":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}},"v":{"docs":{},"i":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}}}},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"s":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"(":{"docs":{},"'":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}},"$":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"r":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}},"i":{"docs":{},"m":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"population.html":{"ref":"population.html","tf":0.006896551724137931},"leader-election.html":{"ref":"leader-election.html","tf":0.024291497975708502},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}},"c":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{},"i":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}}},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}}},"e":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"u":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"s":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}}}}}}},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"e":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"/":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},".":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},":":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.024539877300613498}}}},"r":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"s":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}}}}}}},"a":{"docs":{},"d":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.024291497975708502},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":10},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"v":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815}}}}}}},"i":{"docs":{},"b":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},"f":{"docs":{},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"s":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"v":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.009345794392523364}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.06451612903225806},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.02304147465437788}},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"$":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}},"u":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":10}}}}}},"l":{"docs":{},"y":{"docs":{},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"o":{"docs":{},"k":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"g":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.018518518518518517}},"i":{"docs":{},"c":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"a":{"docs":{},"d":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"n":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}},"e":{"docs":{},"r":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"s":{"docs":{},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"m":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"}":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.06756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},"y":{"docs":{},"'":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},")":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.013513513513513514}},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},"s":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"e":{"docs":{},"o":{"docs":{},"r":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"docs":{},")":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"v":{"1":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}},"docs":{}}}}}}},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"r":{"docs":{},"g":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"k":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.024844720496894408}}}},"p":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}}}},"x":{"docs":{},"i":{"docs":{},"m":{"docs":{},"u":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"n":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"a":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"r":{"docs":{},"k":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834}}}},"d":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}},"e":{"docs":{},"d":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},";":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}},"n":{"docs":{},"d":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"d":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":5.00907029478458}}}}}}}}}},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.03056768558951965}},"e":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},",":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"y":{"docs":{},"j":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"e":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"n":{"docs":{},"g":{"docs":{},"o":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.006896551724137931},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{},"p":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}}}}}}}}}}}}}}}}}}}}}}},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"g":{"docs":{},"t":{"docs":{},"(":{"1":{"8":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}},"docs":{}},"docs":{}}}},"l":{"docs":{},"t":{"docs":{},"(":{"1":{"8":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"{":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"d":{"docs":{},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}}}},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}}}},"{":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"y":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"0":{"0":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}},"docs":{}},"docs":{}},"docs":{}},"docs":{},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.006896551724137931},"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},".":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},"$":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},")":{"docs":{},"{":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136}},"e":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"y":{"docs":{},".":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"_":{"docs":{},";":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"$":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},".":{"docs":{},"j":{"docs":{},"p":{"docs":{},"g":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"e":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136}}}}}}}},"e":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},";":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"d":{"5":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}},"docs":{}}},"p":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},".":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},",":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.02947845804988662}}}}}}},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}},"s":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.01059322033898305},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},"g":{"docs":{},"e":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"e":{"docs":{},"e":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749}}}},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"a":{"docs":{},"g":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"k":{"docs":{"install.html":{"ref":"install.html","tf":0.012269938650306749},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"e":{"docs":{},"c":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}},"o":{"docs":{},"l":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124}},"l":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},";":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}},".":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}},"s":{"docs":{},",":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{},"d":{"docs":{},"b":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"replication.html":{"ref":"replication.html","tf":0.018691588785046728},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},",":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"population.html":{"ref":"population.html","tf":10.017241379310345}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931}}}}}}}}}},"s":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"r":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"e":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"v":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.006802721088435374}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623}}}}}},"o":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.007159904534606206},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.01680672268907563},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}},"e":{"docs":{},"(":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}},".":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.013793103448275862}}}}}},"y":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.045871559633027525}},"e":{"docs":{},"s":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"x":{"docs":{},"i":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"t":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}},"s":{"docs":{},":":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}},":":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"s":{"docs":{},"h":{"docs":{},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"u":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236},"plugins.html":{"ref":"plugins.html","tf":10.03211009174312}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}}},"s":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"u":{"docs":{},"d":{"docs":{},"o":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"p":{"docs":{},"i":{"docs":{},"l":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433}}}}}}}},"c":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"c":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}},"u":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.011933174224343675},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01050420168067227},"rx-collection.html":{"ref":"rx-collection.html","tf":0.006355932203389831},"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.02336448598130841},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"replication.html":{"ref":"replication.html","tf":0.014018691588785047},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},")":{"docs":{},";":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748}}}}}},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496}}}}}},"v":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"a":{"docs":{},"s":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"b":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"leader-election.html":{"ref":"leader-election.html","tf":0.032388663967611336}},"l":{"docs":{},"e":{"docs":{},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}},"s":{"docs":{},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"k":{"docs":{},"e":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.062111801242236024}},"s":{"docs":{},",":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}},"/":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},":":{"docs":{},"n":{"docs":{},"o":{"docs":{},"d":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}}},"a":{"docs":{},"m":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"m":{"docs":{},"p":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}}}}}}}},"n":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"h":{"docs":{},"i":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},"e":{"docs":{},";":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}}},",":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}},"n":{"docs":{},"g":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"m":{"docs":{},",":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"s":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"n":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747}}}}},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"n":{"docs":{},",":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732}}},":":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"w":{"docs":{},"o":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"o":{"docs":{},"p":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},",":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.02100840336134454}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0273109243697479},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.034482758620689655}}},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"o":{"docs":{},"f":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"u":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}},"s":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.02386634844868735},"rx-schema.html":{"ref":"rx-schema.html","tf":0.01680672268907563},"rx-collection.html":{"ref":"rx-collection.html","tf":0.019067796610169493},"rx-document.html":{"ref":"rx-document.html","tf":0.007259528130671506},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.011337868480725623},"orm.html":{"ref":"orm.html","tf":0.013824884792626729},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.009216589861751152},"custom-build.html":{"ref":"custom-build.html","tf":0.021834061135371178},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"a":{"docs":{},"g":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.037037037037037035}},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"s":{"docs":{},"'":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},"'":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"'":{"docs":{},")":{"docs":{},".":{"docs":{},"e":{"docs":{},"q":{"docs":{},"(":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"n":{"docs":{},"i":{"docs":{},"q":{"docs":{},"u":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"e":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}}},"x":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}},"t":{"docs":{},"i":{"docs":{},"l":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"e":{"docs":{},"_":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}},"p":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"custom-build.html":{"ref":"custom-build.html","tf":0.006550218340611353}},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}},"/":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"/":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644}},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-document.html":{"ref":"rx-document.html","tf":0.010889292196007259}},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"middleware.html":{"ref":"middleware.html","tf":0.013605442176870748},"custom-build.html":{"ref":"custom-build.html","tf":0.028384279475982533}},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},")":{"docs":{},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}}},";":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.004366812227074236}}}},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},":":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}},"u":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-document.html":{"ref":"rx-document.html","tf":0.018148820326678767},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"population.html":{"ref":"population.html","tf":0.006896551724137931},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}},",":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}},".":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"j":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"data-migration.html":{"ref":"data-migration.html","tf":0.023195876288659795},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}},":":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.008403361344537815},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.010344827586206896}}},"s":{"docs":{},".":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},".":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}},"i":{"docs":{},"a":{"docs":{"population.html":{"ref":"population.html","tf":0.006896551724137931},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"i":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}},".":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"r":{"docs":{},"n":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"y":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}},"s":{"docs":{},"t":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{"install.html":{"ref":"install.html","tf":0.006134969325153374},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678}}}},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}}}}},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"i":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"d":{"docs":{},"e":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}},".":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152}}}}},"r":{"docs":{},"e":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"population.html":{"ref":"population.html","tf":0.006896551724137931},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118},"contribute.html":{"ref":"contribute.html","tf":0.018633540372670808}},"!":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}},"s":{"docs":{},"!":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}}},"r":{"docs":{},"y":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}},"i":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"middleware.html":{"ref":"middleware.html","tf":0.009070294784580499}}}}},"e":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}}},"a":{"docs":{},"p":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}},"e":{"docs":{},"b":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"t":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.012145748987854251}}}}}}}}}}},"{":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-schema.html":{"ref":"rx-schema.html","tf":0.06092436974789916},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.012704174228675136},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723},"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248},"orm.html":{"ref":"orm.html","tf":0.02304147465437788},"population.html":{"ref":"population.html","tf":0.05172413793103448},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"leader-election.html":{"ref":"leader-election.html","tf":0.008097165991902834},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.012345679012345678},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.018433179723502304},"plugins.html":{"ref":"plugins.html","tf":0.027522935779816515}},"$":{"docs":{},"e":{"docs":{},"q":{"docs":{},":":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"}":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"}":{"docs":{"install.html":{"ref":"install.html","tf":0.018404907975460124},"rx-schema.html":{"ref":"rx-schema.html","tf":0.014705882352941176},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"orm.html":{"ref":"orm.html","tf":0.04608294930875576},"population.html":{"ref":"population.html","tf":0.03793103448275862},"data-migration.html":{"ref":"data-migration.html","tf":0.01288659793814433},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729},"plugins.html":{"ref":"plugins.html","tf":0.009174311926605505}},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},";":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00954653937947494},"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00847457627118644},"rx-document.html":{"ref":"rx-document.html","tf":0.014519056261343012},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.008403361344537815},"middleware.html":{"ref":"middleware.html","tf":0.0045351473922902496},"orm.html":{"ref":"orm.html","tf":0.03225806451612903},"population.html":{"ref":"population.html","tf":0.02413793103448276},"data-migration.html":{"ref":"data-migration.html","tf":0.007731958762886598},"leader-election.html":{"ref":"leader-election.html","tf":0.016194331983805668},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.029411764705882353},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"middleware.html":{"ref":"middleware.html","tf":0.047619047619047616},"population.html":{"ref":"population.html","tf":0.010344827586206896},"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}},";":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"population.html":{"ref":"population.html","tf":0.0034482758620689655},"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}},"$":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765},"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},":":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"replication.html":{"ref":"replication.html","tf":0.018691588785046728}}},"=":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}}}},"r":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}},"$":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"$":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}},"|":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"|":{"docs":{},"b":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"i":{"docs":{},"a":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},")":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}}}},"l":{"docs":{"in-memory.html":{"ref":"in-memory.html","tf":0.006756756756756757}}}},"n":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"contribute.html":{"ref":"contribute.html","tf":0.006211180124223602}}}}}}},")":{"docs":{"middleware.html":{"ref":"middleware.html","tf":0.0022675736961451248}},"=":{"docs":{},">":{"docs":{},"'":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"'":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}}}}}},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},")":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},")":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}},"*":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.010309278350515464},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417},"plugins.html":{"ref":"plugins.html","tf":0.03211009174311927}},"/":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.005154639175257732},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576},"plugins.html":{"ref":"plugins.html","tf":0.013761467889908258}},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}}}}}},".":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.012605042016806723}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.002386634844868735},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661},"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"rx-database.html":{"ref":"rx-database.html","tf":0.00477326968973747},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},".":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}},"u":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322}}}}}}}}}}}},"'":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"e":{"docs":{},"v":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0054446460980036296}}}}}}}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},":":{"docs":{"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"e":{"docs":{},"(":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"v":{"docs":{},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}},".":{"docs":{"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}}}},"[":{"1":{"docs":{},",":{"2":{"docs":{},",":{"3":{"docs":{},",":{"4":{"docs":{},"]":{"docs":{},".":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{},"(":{"docs":{},"n":{"docs":{},"r":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.003629764065335753}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}},"\"":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},"]":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}},"'":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},",":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}}}}}}}}},"]":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"=":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"]":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}}}}}}}}}}}}}}},"^":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"`":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}}}}},"`":{"docs":{},"`":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537},"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}},"o":{"docs":{},"r":{"docs":{"custom-build.html":{"ref":"custom-build.html","tf":0.002183406113537118}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576},"population.html":{"ref":"population.html","tf":0.0034482758620689655}},":":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"e":{"docs":{},"p":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}},"n":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}}},"i":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"'":{"docs":{},",":{"docs":{"orm.html":{"ref":"orm.html","tf":0.004608294930875576}}}}}}},"n":{"docs":{},"g":{"docs":{},"!":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}}}}}},"z":{"0":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.004201680672268907},"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}},"docs":{},"]":{"docs":{},"[":{"docs":{},"[":{"docs":{},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0021008403361344537}}}},"a":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00211864406779661}}}}},"a":{"docs":{"rx-schema.html":{"ref":"rx-schema.html","tf":0.0063025210084033615}}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"rx-collection.html":{"ref":"rx-collection.html","tf":0.00423728813559322},"rx-query.html":{"ref":"rx-query.html","tf":0.03164556962025317},"replication.html":{"ref":"replication.html","tf":0.009345794392523364},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.030864197530864196},"in-memory.html":{"ref":"in-memory.html","tf":0.02027027027027027},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.004608294930875576}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},",":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}},"y":{"docs":{},".":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"{":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}},"$":{"docs":{},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"(":{"docs":{},"u":{"docs":{},"s":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"'":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"'":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.012658227848101266}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}},".":{"docs":{},"e":{"docs":{},"x":{"docs":{},"e":{"docs":{},"c":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"rx-query.html":{"ref":"rx-query.html","tf":0.006329113924050633}}}}}}}}}}}}}}}}}}}},":":{"docs":{"replication.html":{"ref":"replication.html","tf":0.004672897196261682}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":10.030864197530864}},"o":{"docs":{},"r":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}},".":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}},"d":{"docs":{},"e":{"docs":{},"b":{"docs":{},"u":{"docs":{},"g":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907}}}}}}},"!":{"docs":{},"[":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"f":{"docs":{},"]":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"/":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},".":{"docs":{},"g":{"docs":{},"i":{"docs":{},"f":{"docs":{},")":{"docs":{"rx-document.html":{"ref":"rx-document.html","tf":0.0018148820326678765}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"=":{"docs":{},"=":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},")":{"docs":{},";":{"docs":{"rx-attachment.html":{"ref":"rx-attachment.html","tf":0.004201680672268907},"data-migration.html":{"ref":"data-migration.html","tf":0.002577319587628866},"replication.html":{"ref":"replication.html","tf":0.004672897196261682},"rx-local-document.html":{"ref":"rx-local-document.html","tf":0.013824884792626729}}}},"+":{"docs":{"orm.html":{"ref":"orm.html","tf":0.009216589861751152},"query-change-detection.html":{"ref":"query-change-detection.html","tf":0.006172839506172839}}},"]":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},"_":{"docs":{"population.html":{"ref":"population.html","tf":0.0034482758620689655}}},"y":{"docs":{},"o":{"docs":{},"u":{"docs":{},".":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}}}}},"♛":{"docs":{"leader-election.html":{"ref":"leader-election.html","tf":0.004048582995951417}}},"&":{"docs":{},"&":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525},"contribute.html":{"ref":"contribute.html","tf":0.012422360248447204}}}},"@":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"k":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}}}}},"|":{"docs":{},"|":{"docs":{"plugins.html":{"ref":"plugins.html","tf":0.0045871559633027525}}}}},"length":3005},"corpusTokens":["!==","![synced.gif](files/synced.gif)","\"array\",","\"birthyear\":","\"color\":","\"damage\":","\"dependencies\":","\"describ","\"description\":","\"encrypted\":","\"final\":","\"git+https://git@github.com/pubkey/rxdb.git#commithash\"","\"healthpoints\":","\"hero","\"item\":","\"max\":","\"maxitems\":","\"min\":","\"name\":","\"number\"","\"number\",","\"object\",","\"primary\":","\"properties\":","\"required\":","\"rxdb\":","\"secret\":","\"skills\":","\"string\"","\"string\",","\"title\":","\"type\":","\"uniqueitems\":","\"version\":","$","$inc:","$set:","&&","'","'!!';","'');","'',","'aaah!!'","'aaah!!';","'alice'","'alice',","'anyvalue';","'array',","'babel","'bar'","'bar');","'bar';","'bar2'","'bar2');","'barfoo';","'bi","'bob'","'bob',","'carol'","'carol',","'cat.jpg'","'cat.txt',","'dave'","'dies'.","'foo',","'foo'.","'foo'}})","'foobar'","'foobar');","'foobar',","'foobar';","'foobar2'","'foobar2');","'foobar2';","'heroes'","'heroes',","'heroesdb',","'http://localhost:10102/db/',","'human","'human'","'human',","'humans',","'i","'image/jpeg'","'integer',","'kelso'","'kelso';","'lastname']","'localstorage');","'localstorage',","'memdown';","'meow","'messages',","'mycollection.hello()'","'mydatabase',","'myfield',","'mypassword',","'name'","'npm","'object',","'pouchdb","'rxdb';","'rxdb/plugins/adapt","'rxdb/plugins/ajv","'rxdb/plugins/attachments';","'rxdb/plugins/core';","'rxdb/plugins/encryption';","'rxdb/plugins/error","'rxdb/plugins/in","'rxdb/plugins/json","'rxdb/plugins/key","'rxdb/plugins/lead","'rxdb/plugins/loc","'rxdb/plugins/no","'rxdb/plugins/replication';","'rxdb/plugins/schema","'rxdb/plugins/update';","'rxdb/plugins/validate';","'rxjs';","'rxjs/add/operator/filter';","'rxjs/add/operator/first';","'rxjs/add/operator/map';","'rxjs/add/operator/mergemap';","'rxjs/operators/filter';","'rxjs/subject';","'sendercountry'","'skeletor'","'string'","'string',","'temperature',","'text/plain'","'weatherdb',","'websql',","'world';","($)","()","()=>'bar'","(all","(also","(anyth","(async)","(default)","(optional)","(optional=false)","(optional=true)","(or","(password","(primari","(proto)","(remot","(string)","(string|blob|buffer)","(synced$","(version:","(via",");","*","*/","*/).then(()","+",".","..",".collection()",".create()",".exec()'",".exec().then(doc",".exec().then(docu",".find()",".insert()",".migratepromise():",".reduce((prev,",".save()",".subscribe(changeev",".subscribe(newnam",".then(()",".then(collect",".then(json",".then(respons",".upsert()",".where()","/*","/**","//","//>","//[insert","0","0,","0.","02","1","10","10);","100","100));","1000","12","12t23:03:05+00:00","1486940585","18","1900,","1:","2","2)","20","2017","2050","2:","4","409","5","5,","50,","6*5=30","7","77;","9]$","9]*$.","9_]*]?[a","=","==","=>",">","@link","@param","[","[\"color\"]","['firstname',","[1,2,3,4].foreach(nr","[];","[default=true]","]","^[a","_","```","```html","`queri","abov","access","access.","accident","accomplish","action","active$","actual","ad","adapt","adapter,","adapter:","adapters.","add","addit","additionalproperti","advantag","advantages:","affect","afterward","afterwards.","ag","again.","age:","ajv","algorithm","alic","allattachments$","allattachments()","allow","alreadi","altern","alway","amount","angular","anoth","another.","anyth","anyuser.loggedin","anyuser.save();","anyway","api","app","app,","app.","appear","argument,","array","array.","ask","assign","assigned.","assum","assur","async","asynchron","asynchronous.","at.","atom","atomicupdate()","atomicupdate:","atomicupsert()","attach","attachment'","attachment.","attachment.getdata();","attachment.getstringdata();","attachment.remove();","attachments,","attachments:","attribut","attribute.","attributes/methods.","automat","automigr","automigrate:","avail","avoid","await","awesom","b","babel","bandwidth","bar.","base","basic","batteri","becom","befor","before.","behav","behavior","belong","bestfriend","bestfriend:","beta","better","between","big","bigger","binari","birthyear","bit","blob","blobbuff","block","boolean","both.","browser","browsers,","browsers.","buffer.","bug,","bugfix","build","build,","builds.","builds/src/plugin.j","cach","calcul","call","call)","call.","cancel","cancel()","capabl","case","cd","certain","chain","chang","change$","change.","changed.","changeev","changes,","changes.","characters.","charts,","check","check'));","check';","checkadapt","checkadapter()","cherri","choos","class","classes,","cleanup","clear","click","client","client'","clone","closed,","closed.","code","code.","collect","collection'","collection,","collection.","collection.options.foo();","collection2","collection2);","collection:","collections.","color","combin","come","commit","commit.","commithash","common","community.","compar","complete$","complete.","completed.","completes.","complex","compliant","compound","compoundindex","compress","compress,","compression'));","compression',","compression';","compression,","computer.","conflict","conform","connect","connections.","cons:","console.","console.dir(active));","console.dir(bestfriend);","console.dir(change));","console.dir(changeevent));","console.dir(collection));","console.dir(completed));","console.dir(currentname);","console.dir(currentnestedvalue);","console.dir(doc));","console.dir(docdata));","console.dir(documents));","console.dir(error));","console.dir(friends);","console.dir(isname);","console.dir(json));","console.dir(mother);","console.dir(mydatabase.heroes.name);","console.dir(mydocument.age);","console.dir(ok);","console.dir(results);","console.dir(state),","console.error(error),","console.log","console.log('done')","console.log('done'));","console.log('long","console.log(attachment.scream());","console.log(collect","console.log(doc.myfield);","console.log(doc.scream());","console.log(doc.whoami());","console.log(heroes.scream());","console.log(heroes.whoami());","console.log(laststate);","console.log(mydocument.deleted);","console.log(mydocument.firstname);","console.log(mydocument.get('firstname'));","console.log(mydocument.synced);","const","constructed.","contain","continu","contribut","contributing!","contribution,","control","coordin","cordova","core","core,","corner.","correctli","correspond","cost.","couchdb","couchdb,","count","countri","cpu.","creat","created.","creation","crown","crypto","cur)","cur.username+","current","currentnam","currentname;","currentnestedvalu","currentnestedvalue;","custom","damag","data","data,","data.","data:","databas","database)","database,","database.","database:","databases.","datamigr","date","date().gettime()","date(olddoc.time).gettime();","dates.","db","db.","db.collection({","db.heroes;","db.temperature.insert({","db.waitforleadership()","db1","db2","db['heroes']","decid","decrypt","default","default,","default.","default:","default=tru","defin","definit","definition.","degrees:","delet","deleted$","deleted$.","deleted:","depend","describ","destroy","destroy()","destroyed.","detect,","detection`,","dev","develop","developing,","devic","device,","dies,","differ","digest","direct","direction:","directli","directly.","disabl","disablekeycompress","disablekeycompression:","disadvantag","disc","discuss","display","dist","distribut","doc","doc.ag","doc.anyfield","doc.bestfriend_;","doc.populate('bestfriend');","doc.putattachment({","docdata","docs$","docs:instal","docs:serv","document","document,","document.","document.queryselector('body').innerhtml","documents'));","documents';","documents,","documents.","does,","dollarsign","don't","done","done.","done:","driver,","dump","dump'));","dump';","dump()","dure","each","easier","easily.","easy,","edit","elect","election'));","election';","electron","emit","emptydatabase.importdump(json)","enabl","enable()","enabled.","encrypt","encrypted,","encrypted.","encrypted:","engine.","enough","ensur","environment.","equal","error","error$","error('stop');","error.","error:","errors,","es5","es5.","es6","es8","especi","event","events.","everyth","everytim","exact","exactli","exampl","example,","example:","exec","execut","exist","exist.","exists.","expect","expected.","explicitli","export","extend","fals","false),","false);","false,","false.","false;","family:","faster","faster.","featur","feature,","fetch('http://myserver.com/api/countrybycoordinates/'+coordinates+'/')","fetch('https://example.com/api/temp/');","field","field,","field.","fieldnam","fieldname.","fieldnames,","fields.","file","file.","file:","files,","fill","filter","final","final,","final:","find","find()","findone()","finish","finished.","fire","first","firstnam","firstname:","fistname:","fit","flexibl","flow","folder","folder)","folder.","follow","following:","foo","foo:","foobar","for,","foreign","form","found","found.","free","friend","friends:","full","function","function(){","function(olddoc){","function(password)","function.","functionality.","functions,","functions.","gain","generated.","get","get$","get$()","get()","get:","getattachment()","getdata()","getlocal()","getstringdata()","getter","getter.","getter/sett","git","gitter.","given","gone","grate","greater","hand","hand'","handi","handl","handled.","handled:","handler","happen","hard","hash","healthpoint","heatmaps.","heavi","help","here","here.","here]","hero","hero\",","hero.","heroes.findone().exec();","heroes.insert({","higher","hint","hook","hook,","hook?","hooks)","hooks.","hooks:","http","http'));","http://localhost:4000/","https://github.com/pubkey/rxdb.git","https://github.com/pubkey/rxdb/blob/cutsom","https://pouchdb.com/api.html#repl","huge","human","human',","humanscollection.findone('alice').exec();","humanscollection.findone('bob').exec();","humanscollection.insert({","id","id,","id.","id:","ideas:","ident","identifi","idl","idle.","if(olddoc.tim","ignoredupl","ignoreduplicate:","imag","imagin","immut","immutable.","implement","import","import/export","important:","importdump()","imported.","improv","in.","includ","incom","increas","index","index,","index:","indexed,","indexes,","initi","inmemori","input","insert","insert()","insertlocal()","insid","inspect","instal","instanc","instance,","instance.","instantli","instead","instead.","integ","integr","intent","interact","intern","introduct","invalid","io","isnam","isname;","isrxcollect","isrxdatabas","isrxdocu","isrxqueri","issu","it'","it,","it.","items:","javascript","javascript,","javascript.","join","js","json","jsonschema","jump","keep","key","keycompress","keycompressor","keynam","keyword","keyword:","king!');","kitty',","know","known","last","lastnam","lastname:","lastpromis","lastpromise;","laststat","later","later.","latest","lead","leader","leader,","leader.","leaderelect","leaderelection.","learn","leav","length","less","lettabl","level","leveldb","leveldb'));","lib,","life","lifecycl","limit","list","list:","live","live:","load","local","localdoc","localdoc.foo","localdoc.foo;","localdoc.get$('foo').subscribe(valu","localdoc.get('foo');","localdoc.remove();","localdoc.save();","localdoc.set('foo',","localdocu","locally,","localstorage'));","locat","log","logic","long","longer","look","looks.","lot","made","main","make","manag","mani","manipul","manipulate.","manual","map","mark","match","matter","maximum","md5","mean","means,","meant","memcol","memcol.find().exec();","memdown","memdown});","memori","memory'));","memory';","memory)","merg","messag","messagecol","messagecol.migratepromise(10);","messages'));","messages';","messages.","messageschemav1,","messeng","metadata.","meteor","method","method,","method.","methods:","middlewar","migrat","migrated.","migrated:","migratepromise;","migrationpromis","migrationstrategi","migrationstrategies:","mind","minute.","mistake,","mode.","model","modifi","modifyjs.","modul","module,","module.","moment","mongo","mongoose,","mongoose.","more","mother","mother:","ms","multiinst","multiinstance:","multipl","mycollect","mycollection.$.subscribe(changeev","mycollection.atomicupsert(docdata);","mycollection.customcleanupfunction();","mycollection.dump()","mycollection.dump(true)","mycollection.find().exec()","mycollection.find().where('age').gt(18)","mycollection.find().where('age').gt(18);","mycollection.find().where('age').lt(18);","mycollection.find().where('name').eq('foo')","mycollection.find({name:","mycollection.findone('foo')","mycollection.findone().exec();","mycollection.findone().where('name').eq('foo')","mycollection.getlocal('foobar');","mycollection.importdump(json)","mycollection.inmemory();","mycollection.insert({","mycollection.insertlocal(","mycollection.newdocument({","mycollection.postcreate(function(doc){","mycollection.postinsert(function(documentdata){","mycollection.postremove(function(doc){","mycollection.postsave(function(doc){","mycollection.preinsert(function(documentdata){","mycollection.preremove(function(doc){","mycollection.presave(function(doc){","mycollection.remove();","mycollection.sync(","mycollection.upsert(docdata);","mycollection.upsert({","mycollection.upsertlocal(","mydatabase.collection({","mydatabase.destroy();","mydatabase.dump()","mydatabase.dump(true)","mydatabase.insertlocal(","mydatabase.remove();","mydatabase.requestidlepromise().then(()","mydatabase.requestidlepromise(1000","mydb.$.subscribe(changeev","mydocument.$()","mydocument.ag","mydocument.allattachments$.subscribe(","mydocument.allattachments();","mydocument.atomicupdate(function(doc){","mydocument.deleted$.subscribe(st","mydocument.family.mother_;","mydocument.firstnam","mydocument.firstname$","mydocument.friends_;","mydocument.get$('name')","mydocument.get('name');","mydocument.getattachment('cat.jpg');","mydocument.nam","mydocument.name;","mydocument.putattachment({","mydocument.remove();","mydocument.resync();","mydocument.save();","mydocument.set('firstname',","mydocument.set('name',","mydocument.synced$.subscribe(st","mydocument.update({","mydocument.whatever.nestedfield","mydocument.whatever.nestedfield$","mydocument.whatever.nestedfield;","myheroschema","myplugin","myschema","myschema,","name","name.","name:","name:foobar","names.","nativ","need","need.","ness","nest","nestedvalu","never","new","new,","new.","newdocument()","newer","newest","newli","newname;","next","nodej","non","normal","not.","note","noth","notic","notice:","notif","notifi","now","now,","npm","nr;","null","null,","null;","number","number,","number.","object","object,","object.","object.defineproperty(doc,","observ","occur","off,","offlin","ok","old","olddoc.coordinates;","olddoc.sendercountry=response;","olddoc.tim","olddoc;","older","on","once.","open","oper","operations.","operators,","operators.","oplog","optim","optimis","option","options.","options:","origin","orm","orm/drm","other.","otherwis","out","over","overwrit","overwritable:","overwritten","package.json,","package.json.","page","parallel","paramet","parameter,","parameter.","parameters.","parent","parrallel","part","pass","password","password.","password.length","password:","path","peer","per","percent:","percentag","perform","performance,","pick","piec","pleas","plu","plugin","plugin.","plugins:","point","polling.","polyfil","polyfill');","polyfill';","polyfill.","polyfills,","popul","populate()","post","postcreat","postinsert","postremov","postsav","pouch/couch","pouchadaptermemori","pouchdb","pouchdb,","pouchset","power","pr","pre","prefil","preinsert","preremov","presav","prev","prevent","previou","primari","primary,","primary.","primary:","problem","process,","produce,","product","promis","promise(r","promise.","properti","properties:","property.","pros:","proto.hello","protocol.","prototyp","prototypes:","provid","proxi","pseudo","pull","pull:","push:","putattachment()","queri","queries,","queries.","query.","query.$.subscribe(us","query.remove();","query.update({","query:","querychangedetect","querychangedetector","querychangedetector.enable();","querychangedetector.enabledebugging();","queryobject","queryobject.exec();","queryobject.sort('name');","queryobjectsort","queryobjectsort.exec();","quota","ram","rare","re","react","reactiv","reactive,","read","realli","reassign","receiv","recogn","record","reduc","redund","reestablished.","ref","ref:","refer","referenc","refhuman","refind","regex","regex:","regular","relat","releas","reli","remains:","remot","remote:","remov","remove()","removed.","removeddoc","replac","replic","replicated.","replication,","replication.","replications.","replicationst","replicationstate.active$.subscribe(act","replicationstate.cancel();","replicationstate.change$.subscribe(chang","replicationstate.complete$.subscribe(complet","replicationstate.docs$.subscribe(docdata","replicationstate.error$.subscribe(error","repositori","repres","reproduc","request","request,","requestidlecallback","requestidlepromise()","requir","require('babel","require('rxdb');","require('rxdb/plugins/core');","require('rxjs');","required.","required:","resolv","resourc","respons","response.json();","result","result.","resync","resync()","retry:","return","returning.","reus","rev","revis","right","run","run:","running.","runtime,","rx.collection.sync()","rxattach","rxattachemnt","rxchangeevent.","rxcollect","rxcollection().inmemory();","rxcollection,","rxcollection.","rxcollection.insert","rxcollection.newdocument(initaldata).","rxcollection.sync()","rxcollection.sync().","rxcollection:","rxcollections,","rxdatabas","rxdatabase.","rxdb","rxdb'","rxdb,","rxdb.","rxdb.checkadapter('localstorage');","rxdb.create({","rxdb.create({name:","rxdb.isrxcollection(myobj);","rxdb.isrxdatabase(myobj);","rxdb.isrxdocument(myobj);","rxdb.isrxquery(myobj);","rxdb.plugin()","rxdb.plugin(pouchadaptermemory);","rxdb.plugin(require('pouchdb","rxdb.plugin(require('rxdb/plugins/adapt","rxdb.plugin(require('rxdb/plugins/ajv","rxdb.plugin(require('rxdb/plugins/attachments'));","rxdb.plugin(require('rxdb/plugins/encryption'));","rxdb.plugin(require('rxdb/plugins/error","rxdb.plugin(require('rxdb/plugins/in","rxdb.plugin(require('rxdb/plugins/json","rxdb.plugin(require('rxdb/plugins/key","rxdb.plugin(require('rxdb/plugins/lead","rxdb.plugin(require('rxdb/plugins/loc","rxdb.plugin(require('rxdb/plugins/no","rxdb.plugin(require('rxdb/plugins/replication'));","rxdb.plugin(require('rxdb/plugins/schema","rxdb.plugin(require('rxdb/plugins/update'));","rxdb.plugin(require('rxdb/plugins/validate'));","rxdb.plugin(rxdbadaptercheckmodule);","rxdb.plugin(rxdbajvvalidatemodule);","rxdb.plugin(rxdbattachmentsmodule);","rxdb.plugin(rxdbencryptionmodule);","rxdb.plugin(rxdbinmemorymodule);","rxdb.plugin(rxdbjsondumpmodule);","rxdb.plugin(rxdbkeycompressionmodule);","rxdb.plugin(rxdbleaderelectionmodule);","rxdb.plugin(rxdblocaldocumentsmodule);","rxdb.plugin(rxdbnovalidatemodule);","rxdb.plugin(rxdbreplicationmodule);","rxdb.plugin(rxdbschemacheckmodule);","rxdb.plugin(rxdbupdatemodule);","rxdb.plugin(rxdbvalidatemodule);","rxdb.removedatabase('mydatabasename',","rxdb:","rxdbadaptercheckmodul","rxdbajvvalidatemodul","rxdbattachmentsmodul","rxdbencryptionmodul","rxdberrormessagesmodul","rxdbinmemorymodul","rxdbjsondumpmodul","rxdbkeycompressionmodul","rxdbleaderelectionmodul","rxdblocaldocumentsmodul","rxdbnovalidatemodul","rxdbreplicationmodul","rxdbschemacheckmodul","rxdbupdatemodul","rxdbvalidatemodul","rxdocument","rxdocument)","rxdocument,","rxdocument.","rxdocument.atomicupdate.","rxdocument.remov","rxdocument.sav","rxdocument.upd","rxdocument[alice]","rxj","rxjs'","rxlocaldocu","rxlocaldocument.","rxqueri","rxquery'","rxquery.","rxquery.update.","rxreplicationst","rxschema","rxschema.","same","save","save'","save()","save().","save,","saved.","schema","schema\",","schema'","schema,","schema.","schema.org.","schema:","schema?","schemacheck","schemas,","schemas.","schemaversions.","schemawithdefaultag","schemawithfinalag","schemawithindex","scream:","search","second","secondari","seconds.","secret","see","semi","send","sender","sent","seri","server","serverless,","serverless.","serverurl,","set","set()","set).","settimeout(res,","settings:","share","short","show","side","side,","signal","similar","simpl","simple.","singl","site","size,","size.","skeletor!!'","skill","slow","small","solut","solv","someon","someth","sometim","sort","sourc","spawn","spec","special","specif","specifi","speed","src","standard","standart","start","state","state);","static","static.","statics:","stay","still","stop","storag","storage.","store","strategi","stream","stream.","string","string,","string.","structur","subject","submit","subscrib","succeed","success:","suffix","sum","support","sure","sync","sync()","sync.","synced$","synced$.","synchron","synchronis","syntax,","system","tab","tab.","table.","tabs,","tabs.","take","task","tasks.","team","temp","temp,","tempdoc","tempdoc.ag","tempdoc.lastnam","tempdoc.save();","temperatur","temporari","ten","test","test/unit","test:nod","tests,","thank","them,","then,","therefor","these","thing","things.","this,","this.","this.nam","this.name;","this:","thousand","through","throw","thrown.","time","time,","time.","time:","timeout","timespan,","timestamp","title:","to,","to.","togeth","top","toplist","total:","track","traffic","transform","transpil","tri","trigger","trivial","true","true);","true,","true.","two","type","type.","type:","typeof","u","undefin","underscor","underscore_","uniqu","unique,","unit","unix","unset","until","up","updat","update()","update/insert/remov","upon","upsert","upsert()","upsertlocal()","us","usag","used:","user","user'","user,","users'","users.","userscollection.find().where('loggedin').eq(true).sort('points');","valid","valid.","validate'));","validate';","validatepassword:","validation.","valu","value,","value.","values.","vanillaj","var","variou","veri","version","version,","version.","version:","versions.","via","visitor","wait","wait..","waitforleadership()","waitforleadership:","want","warn","warning:","wast","way","websit","websocket","whatev","whenev","whether","while,","whoami:","whole","wide","wide.","window","wire","within","without","work","work!","work.","works!","worry,","wrap","write","written","wrong.","you.","z0","z][[a","z][a","za","zero","{","{$eq:","{object}","||","}","})","});","},","};","♛"],"pipeline":["stopWordFilter","stemmer"]},"store":{"./":{"url":"./","title":"Introduction","keywords":"","body":"\n \n \n \n\n\n\n Reactive, serverless, client-side, offline-first database in javascript.\n\n\n\n \n \n \n \n \n \n\n \n -->\n\n\n\n\n If you are new to RxDB, you should start here.\n\n"},"install.html":{"url":"install.html","title":"Install","keywords":"","body":"Install\nnpm\nTo install the latest release of rxdb and its dependencies and save it to your package.json, run:\nnpm i rxdb --save\npeer-dependency\nYou also need to install the peer-dependency rxjs if you not have installed it before.\nnpm i rxjs --save\npolyfills\nRxDB is coded with es8 and transpiled to es5. This means you have to install polyfills to support older browsers.\nnpm i babel-polyfill --save\nLatest\nIf you need the latest develop-state of RxDB, add it as git-dependency into your package.json.\n \"dependencies\": {\n \"rxdb\": \"git+https://git@github.com/pubkey/rxdb.git#commitHash\"\n }\n\nReplace commitHash with the hash of the latest build-commit.\nImport\nTo import rxdb, add this to your javascript file:\n// es6\nimport RxDB from 'rxdb';\n\n// es5\nvar rxdb = require('rxdb');\n\nIf you have not included es8-polyfills, you also have to import babel-polyfill.\n// es6\nimport 'babel-polyfill';\n\n// es5\nrequire('babel-polyfill');\n\nrxjs\nTo reduce the build-size, RxDB is using rxjs's lettable-operators. This means that by default only some parts of rxjs are included into RxDB. If you want to use additional operators, you either have to require the whole rxjs-lib, or also use the lettable-operators. Another alternative is to cherry-pick the needed operators.\n// full import\nimport 'rxjs'; // es6\nrequire('rxjs'); // es5\n\n// lettable\nimport { Subject } from 'rxjs/Subject';\nimport { filter } from 'rxjs/operators/filter';\n\n// cherry-pick\nimport 'rxjs/add/operator/map'; \nimport 'rxjs/add/operator/mergeMap'; \nimport 'rxjs/add/operator/filter'; \nimport 'rxjs/add/operator/first';\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-database.html":{"url":"rx-database.html","title":"RxDatabase","keywords":"","body":"RxDatabase\nA RxDatabase-Object contains your collections and handles the synchronisation of change-events.\nCreation\nThe database is created by the asynchronous .create()-function of the main RxDB-module. It has the following 4 parameters.\nconst db = await RxDB.create({\n name: 'heroesdb', // \nname\nThe database-name is a string which uniquely identifies the database. When two RxDatabases have the same name and use the same storage-adapter, their data can be assumed as equal and they will share change-events between each other.\nDepending on the adapter this can also be used to define the storage-folder of your data.\nadapter\nThe storage-adapter defines where the data is actually stored at. You can use a string for pouchdb-adapters or an object for level-adapters. To use an adapter it must before have been added with the RxDB.plugin()-function.\nBefore using a level-adapter, you have to add the pouchdb-adapter-leveldb module.\nExample with level-adapter:\nimport memdown from 'memdown';\nRxDB.plugin(require('pouchdb-adapter-leveldb'));\nconst db = await RxDB.create({name: 'mydatabase', adapter: memdown});\n\npassword\n(optional)\nIf you want to use encrypted fields in the collections of a database, you have to set a password for it. The password must be a string with at least 12 characters.\nmultiInstance\n(optional=true)\nWhen you create more than one instance of the same database in a single javascript-runtime, you should set multiInstance to true. This will enable the event-sharing between the two instances serverless. This should be set to false when you have single-instances like a single nodejs-process, a react-native-app, a cordova-app or a single-window electron-app.\nignoreDuplicate\n(optional=false)\nIf you create multiple RxDatabase-instances with the same name and same adapter, it's very likely that you have done something wrong.\nTo prevent this common mistake, RxDB will throw an error when you do this.\nIn some rare cases like unit-tests, you want to do this intentional by setting ignoreDuplicate to true.\nconst db1 = await RxDB.create({\n name: 'heroesdb',\n adapter: 'websql',\n ignoreDuplicate: true\n});\nconst db2 = await RxDB.create({\n name: 'heroesdb',\n adapter: 'websql',\n ignoreDuplicate: true // this create-call will not throw because you explicitly allow it\n});\n\nFunctions\nObserve with $\nCalling this will return an rxjs-Observable which streams every change to data of this database.\nmyDb.$.subscribe(changeEvent => console.dir(changeEvent));\n\nwaitForLeadership()\nReturns a Promise which resolves when the RxDatabase becomes elected leader.\ndump()\nUse this function to create a json-export from every piece of data in every collection of this database. You can pass true as a parameter to decrypt the encrypted data-fields of your document.\nmyDatabase.dump()\n .then(json => console.dir(json));\n\n// decrypted dump\nmyDatabase.dump(true)\n .then(json => console.dir(json));\n\nimportDump()\nTo import the json-dumps into your database, use this function.\n// import the dump to the database\nemptyDatabase.importDump(json)\n .then(() => console.log('done'));\n\nrequestIdlePromise()\nReturns a promise which resolves when the database is in idle. This works similar to requestIdleCallback but tracks the idle-ness of the database instead of the CPU.\nUse this for semi-important tasks like cleanups which should not affect the speed of important tasks.\n\nmyDatabase.requestIdlePromise().then(() => {\n // this will run at the moment the database has nothing else to do\n myCollection.customCleanupFunction();\n});\n\n// with timeout\nmyDatabase.requestIdlePromise(1000 /* time in ms */).then(() => {\n // this will run at the moment the database has nothing else to do\n // or the timeout has passed\n myCollection.customCleanupFunction();\n});\n\ndestroy()\nDestroys the databases object-instance. This is to free up memory and stop all observings and replications.\nReturns a Promise that resolves when the database is destroyed.\nawait myDatabase.destroy();\n\nremove()\nRemoves the database and all data of it from the storage.\nawait myDatabase.remove();\n// database is now gone\n\n// NOTICE: You can also remove a database without its instance\nRxDB.removeDatabase('mydatabasename', 'localstorage');\n\ncheckAdapter()\nChecks if the given adapter can be used with RxDB in the current environment.\nRxDB.plugin(require('pouchdb-adapter-localstorage')); // adapter must be added before\n\nconst ok = await RxDB.checkAdapter('localstorage');\nconsole.dir(ok); // true on most browsers, false on nodejs\n\nisRxDatabase\nReturns true if the given object is an instance of RxDatabase. Returns false if not.\nconst is = RxDB.isRxDatabase(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-schema.html":{"url":"rx-schema.html","title":"RxSchema","keywords":"","body":"RxSchema\nSchemas define how your data looks. Which field should be used as primary, which fields should be used as indexes and what should be encrypted. The schema also validates that every inserted document of your collections conforms to the schema. Every collection has its own schema. With RxDB, schemas are defined with the jsonschema-standard so that you don't have to learn anything new.\nExample\nIn this example-schema we define a hero-collection with the following settings:\n\nthe version-number of the schema is 0\nthe name-property is the primary. This means its an unique, indexed, required string which can be used to definitely find a single document.\nthe color-field is required for every document\nthe healthpoints-field must be a number between 0 and 100\nthe secret-field stores an encrypted value\nthe birthyear-field is final which means it is required and cannot be changed\nthe skills-attribute must be an array with objects which contain the name and the damage-attribute. There is a maximum of 5 skills per hero.\n{\n \"title\": \"hero schema\",\n \"version\": 0,\n \"description\": \"describes a simple hero\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"primary\": true\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"healthpoints\": {\n \"type\": \"number\",\n \"min\": 0,\n \"max\": 100\n },\n \"secret\": {\n \"type\": \"string\",\n \"encrypted\": true\n },\n \"birthyear\": {\n \"type\": \"number\",\n \"final\": true,\n \"min\": 1900,\n \"max\": 2050\n },\n \"skills\": {\n \"type\": \"array\",\n \"maxItems\": 5,\n \"uniqueItems\": true,\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"damage\": {\n \"type\": \"number\"\n }\n }\n }\n }\n },\n \"required\": [\"color\"]\n}\n\n\n\nCreate a collection with the schema\nawait myDatabase.collection({\n name: 'heroes',\n schema: myHeroSchema\n});\nconsole.dir(myDatabase.heroes.name);\n// heroes\n\nversion\nThe version field is a number, starting with 0.\nWhen the version is greater than 0, you have to provide the migrationStrategies to create a collection with this schema.\ndisableKeyCompression\nIf you do not want to use the internal key-compression, you can disable it by setting the field disableKeyCompression to true.\nNotice that disableKeyCompression can only be used on the top-level of a schema.\nconst mySchema = {\n disableKeyCompression: true,\n version: 0,\n title: 'human schema no compression',\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n }\n },\n required: ['firstName', 'lastName']\n};\n\nIndexes\nRxDB supports secondary indexes which are defined at the schema-level of the collection.\nTo add a simple index, add index: true inside field options.\nTo add compound-indexes, add them in an array to a compoundIndexes-field at the top-level of the schema-definition.\nIndex is only allowed on field types string, integer and number\nIndex-example\nconst schemaWithIndexes = {\n disableKeyCompression: true,\n version: 0,\n title: 'human schema no compression',\n type: 'object',\n properties: {\n firstName: {\n type: 'string',\n index: true // \ndefault\nDefault values can only be defined for first-level fields.\nWhenever you insert a document or create a temporary-document, unset fields will be filled with default-values.\nconst schemaWithDefaultAge = {\n version: 0,\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n },\n age: {\n type: 'integer',\n default: 20 // \nfinal\nBy setting a field to final, you make sure it cannot be modified later. Final fields are always required.\nFinal fields cannot be observed because they anyway will not change.\nAdvantages:\n- With final fields you can ensure that no other in your dev-team accidentally modifies the data\n- When you enable the `query-change-detection`, some performance-improvements are done\nconst schemaWithFinalAge = {\n version: 0,\n type: 'object',\n properties: {\n firstName: {\n type: 'string'\n },\n lastName: {\n type: 'string'\n },\n age: {\n type: 'integer',\n final: true\n }\n },\n};\n\nNOTICE: Not everything within the jsonschema-spec is allowed\nThe schema is not only used to validate objects before they are written into the database, but also used to map getters to observe and populate single fieldnames, keycompression and other things. Therefore you can not use every schema which would be valid for the spec of json-schema.org.\nFor example, fieldnames must match the regex ^[a-zA-Z][[a-zA-Z0-9_]*]?[a-zA-Z0-9]$ and additionalProperties is always set to false. But don't worry, RxDB will instantly throw an error when you pass a invalid schema into it.\n\nIf you are new to RxDB, you should continue here\n"},"rx-collection.html":{"url":"rx-collection.html","title":"RxCollection","keywords":"","body":"RxCollection\nA collection stores documents of the same type.\nCreating a Collection\nTo create a collection you need a RxDatabase object which has the .collection()-method. Every collection needs a collection name and a valid RxSchema.\nmyDatabase.collection({\n name: 'humans',\n schema: mySchema\n})\n .then(collection => console.dir(collection));\n\nname\nThe name uniquely identifies the collection and should be used to refind the collection in the database. Two different collections in the same database can never have the same name. Collection names must match the following regex: ^[a-z][a-z0-9]*$.\nschema\nThe schema defines how your data looks and how it should be handled. You can pass a RxSchema object or a simple javascript-object from which the schema will be generated.\npouchSettings\nYou can pass settings directly to the pouchdb database create options through this property.\nGet a collection from the database\nTo get an existing collection from the database, call the collection name directly on the database:\n// newly created collection\nconst collection = await db.collection({\n name: 'heroes',\n schema: mySchema\n});\nconst collection2 = db.heroes;\n// or\n// const collection2 = db['heroes']\n\nconsole.log(collection == collection2);\n// true\n\nFunctions\nObserve $\nCalling this will return an rxjs-Observable which streams every change to data of this collection.\nmyCollection.$.subscribe(changeEvent => console.dir(changeEvent));\n\ninsert()\nUse this to insert new documents into the database. The collection will validate the schema and automatically encrypt any encrypted fields. Returns the new RxDocument.\nconst doc = await myCollection.insert({\n name: 'foo',\n lastname: 'bar'\n});\n\nnewDocument()\nSometimes it can be helpful to spawn and use documents before saving them into the database.\nThis is useful especially when you want to use the ORM methods or prefill values from form data.\nYou can create temporary documents by calling RxCollection.newDocument(initalData).\nconst tempDoc = myCollection.newDocument({\n firstName: 'Bob'\n});\n\n// fill in data later\ntempDoc.lastName = 'Kelso';\ntempDoc.age = 77;\n\n// saving a temporary document will transform it to a standard RxDocument\nawait tempDoc.save();\n\nupsert()\nInserts the document if it does not exist within the collection, otherwise it will overwrite it. Returns the new or overwritten RxDocument.\nconst doc = await myCollection.upsert({\n name: 'foo',\n lastname: 'bar2'\n});\n\natomicUpsert()\nWhen you run many upsert operations on the same RxDocument in a very short timespan, you might get a 409 Conflict error.\nThis means that you tried to run a .upsert() on the document, while the previous upsert operation was still running.\nTo prevent these types of errors, you can run atomic upsert operations.\nThe behavior is similar to RxDocument.atomicUpdate.\nconst docData = {\n name: 'Bob', // primary\n lastName: 'Kelso'\n};\n\nmyCollection.upsert(docData);\nmyCollection.upsert(docData);\n// -> throws because of parrallel update to the same document\n\nmyCollection.atomicUpsert(docData);\nmyCollection.atomicUpsert(docData);\nmyCollection.atomicUpsert(docData);\n\n// wait until last upsert finished\nawait myCollection.atomicUpsert(docData);\n// -> works\n\nfind()\nTo find documents in your collection, use this method.\nThis will return a RxQuery object with the exec function.\n// directly pass search-object\nmyCollection.find({name: {$eq: 'foo'}})\n .exec().then(documents => console.dir(documents));\n\n// chained queries\nmyCollection.find().where('name').eq('foo')\n .exec().then(documents => console.dir(documents));\n\nfindOne()\nThis does basically what find() does, but it returns only a single document. You can pass a primary value to find a single document more easily.\n// get document with name:foobar\nmyCollection.findOne().where('name').eq('foo')\n .exec().then(doc => console.dir(doc));\n\n// get document by primary, functionally identical to above query\nmyCollection.findOne('foo')\n .exec().then(doc => console.dir(doc));\n\ndump()\nUse this function to create a json export from every document in the collection. You can pass true as parameter to decrypt the encrypted data fields of your documents.\nmyCollection.dump()\n .then(json => console.dir(json));\n\n// decrypted dump\nmyCollection.dump(true)\n .then(json => console.dir(json));\n\nimportDump()\nTo import the json dump into your collection, use this function.\n// import the dump to the database\nmyCollection.importDump(json)\n .then(() => console.log('done'));\n\ndestroy()\nDestroys the collection's object instance. This is to free up memory and stop all observings and replications.\nmyDatabase.destroy();\n\nsync()\nThis method allows you to replicate data between other RxCollections, pouchdb instances or remove servers which support the couchdb-sync-protocol.\nFull documentation on how to use replication is here.\nremove()\nRemoves all known data of the collection and its previous versions.\nThis removes the documents, the schemas, and older schemaVersions.\nawait myCollection.remove();\n// collection is now removed and can be re-created\n\nisRxCollection\nReturns true if the given object is an instance of RxCollection. Returns false if not.\nconst is = RxDB.isRxCollection(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-document.html":{"url":"rx-document.html","title":"RxDocument","keywords":"","body":"RxDocument\nA document is a single object which is stored in a collection. It can be compared to a single record in a relational database table.\ninsert\nTo insert a document into a collection, you have to call the collection's .insert()-function.\nmyCollection.insert({\n name: 'foo',\n lastname: 'bar'\n});\n\nfind\nTo find documents in a collection, you have to call the collection's .find()-function.\nmyCollection.find().exec() // console.dir(documents));\n\nFunctions\nget()\nThis will get a single field of the document. If the field is encrypted, it will be automatically decrypted before returning.\nvar name = myDocument.get('name'); // returns the name\n\nproxy-get\nAs RxDocument is wrapped into a Proxy-object, you can also directly access values instead of using the get()-function.\n // Identical to myDocument.get('name');\n var name = myDocument.name;\n // Can also get nested values.\n var nestedValue = myDocument.whatever.nestedfield;\n\nset()\nTo change data in your document, use this function. It takes the field-path and the new value as parameter. Note that calling the set-function will not change anything in your storage directly. You have to call .save() after to submit changes.\nmyDocument.set('firstName', 'foobar');\nconsole.log(myDocument.get('firstName')); // \nproxy-set\nAs RxDocument is wrapped into a Proxy-object, you can also directly set values instead of using the set()-function.\nmyDocument.firstName = 'foobar';\nmyDocument.whatever.nestedfield = 'foobar2';\n\nsave()\nThis will update the document in the storage if it has been changed. Call this after modifying the document (via set() or proxy-set).\nmyDocument.name = 'foobar';\nawait myDocument.save(); // submit the changes to the storage\n\nremove()\nThis removes the document from the collection.\nmyDocument.remove();\n\nupdate()\nUpdates the document based on the mongo-update-syntax, based on modifyjs.\nawait myDocument.update({\n $inc: {\n age: 1 // increases age by 1\n },\n $set: {\n fistName: 'foobar' // sets firstName to foobar\n }\n});\n\natomicUpdate()\nWhen you run many save-operations on the same RxDocument in a very short timespan, it can happen that you get a 409 Conflict-Error.\nThis means that you did run a .save() on the document, while the previous save-operation was still running.\nTo prevent these types of errors, you can run atomic update-operations.\natomicUpdate() has a function as argument, which transforms the document and then automatically runs a save().\nIt returns a promise to notify you when the given atomic-update has finished.\nExample to reproduce the 409-error:\n[1,2,3,4].forEach(nr => {\n myDocument.age = nr;\n myDocument.save();\n});\n// throws\n\nUsage of atomicUpdate:\nlet lastPromise;\n[1,2,3,4].forEach(nr => {\n lastPromise = myDocument.atomicUpdate(function(doc){\n doc.age = nr;\n });\n});\nawait lastPromise;\nconsole.dir(myDocument.age); // 4\n\nObserve $\nCalling this will return an rxjs-Observable which emits all change-Events belonging to this document.\n// get all changeEvents\nmyDocument.$()\n .subscribe(changeEvent => console.dir(changeEvent));\n\nget$()\nThis function returns an observable of the given paths-value.\nThe current value of this path will be emitted each time the document changes.\n// get the life-updating value of 'name'\nvar isName;\nmyDocument.get$('name')\n .subscribe(newName => {\n isName = newName;\n });\n\nmyDocument.set('name', 'foobar2');\nawait myDocument.save();\n\nconsole.dir(isName); // isName is now 'foobar2'\n\nproxy-get$\nYou can directly get value-observables for a fieldName by adding the dollarSign ($) to its name.\n// top-level\nvar currentName;\nmyDocument.firstName$\n .subscribe(newName => {\n currentName = newName;\n });\nmyDocument.firstName = 'foobar2';\nawait myDocument.save();\nconsole.dir(currentName); // currentName is now 'foobar2'\n\n// nested\nvar currentNestedValue;\nmyDocument.whatever.nestedfield$\n .subscribe(newName => {\n currentNestedValue = newName;\n });\nmyDocument.whatever.nestedfield = 'foobar2';\nawait myDocument.save();\nconsole.dir(currentNestedValue); // currentNestedValue is now 'foobar2'\n\ndeleted$\nEmits a boolean value, depending on whether the RxDocument is deleted or not.\nlet lastState = null;\nmyDocument.deleted$.subscribe(state => lastState = state);\n\nconsole.log(lastState);\n// false\n\nawait myDocument.remove();\n\nconsole.log(lastState);\n// true\n\nget deleted\nA getter to get the current value of deleted$.\nconsole.log(myDocument.deleted);\n// false\n\nawait myDocument.remove();\n\nconsole.log(myDocument.deleted);\n// true\n\nsynced$\nEmits a boolean value of whether the RxDocument is in the same state as its value stored in the database.\nThis is useful to show warnings when two or more users edit a document at the same time.\nBrowser tab A\nlet lastState = null;\nmyDocument.synced$.subscribe(state => lastState = state);\nconsole.log(lastState);\n// true\n\nmyDocument.firstName = 'foobar';\nconsole.log(lastState);\n// true\n\nBrowser tab B\nmyDocument.firstName = 'barfoo';\nawait myDocument.save();\n\nBrowser tab A\nconsole.log(lastState);\n// false\n\n\n\n Example with Angular 2\n\n\n```html\n\n Warning:\n Someone else has changed this document. If you click save, you will overwrite the changes.\n resync\n\n```\n\n![synced.gif](files/synced.gif)\n\n\nget synced\nA getter to get the current value of synced$.\nBrowser tab A\nconsole.log(myDocument.synced);\n// true\n\nmyDocument.firstName = 'foobar';\nconsole.log(myDocument.synced);\n// true\n\nBrowser tab B\nmyDocument.firstName = 'barfoo';\nawait myDocument.save();\n\nBrowser tab A\nconsole.log(myDocument.synced);\n// false\n\nresync()\nIf the RxDocument is not in sync (synced$ fires false), you can run resync() to overwrite own changes with the new state from the database.\nmyDocument.firstName = 'foobar';\n\n// now someone else overwrites firstName with 'Alice'\n\nmyDocument.resync();\n\nconsole.log(myDocument.firstName);\n// Alice\n\nisRxDocument\nReturns true if the given object is an instance of RxDocument. Returns false if not.\nconst is = RxDB.isRxDocument(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-query.html":{"url":"rx-query.html","title":"RxQuery","keywords":"","body":"RxQuery\nA query defines how to find documents in your collection. With RxDB you can use chained queries.\nremove()\nDeletes all found documents. Returns a promise which resolves to the deleted documents.\n// All documents where the age is less than 18\nconst query = myCollection.find().where('age').lt(18);\n// Remove the documents from the collection\nconst removedDocs = await query.remove();\n\nupdate()\nRuns and update on every RxDocument of the query-result.\nconst query = myCollection.find().where('age').gt(18);\nawait query.update({\n $inc: {\n age: 1 // increases age of every found document by 1\n }\n});\n\nNOTICE: RxQuery's are immutable\nBecause RxDB is a reactive database, we can do heavy performance-optimisation on query-results which change over time. To be able to do this, RxQuery's have to be immutable.\nThis means, when you have a RxQuery and run a .where() on it, the original RxQuery-Object is not changed. Instead the where-function returns a new RxQuery-Object with the changed where-field. Keep this in mind if you create RxQuery's and change them afterwards.\nExample:\nconst queryObject = myCollection.find().where('age').gt(18);\n// Creates a new RxQuery object, does not modify previous one\nqueryObject.sort('name');\nconst results = await queryObject.exec();\nconsole.dir(results); // result-documents are not sorted by name\n\nconst queryObjectSort = queryObject.sort('name');\nconst results = await queryObjectSort.exec();\nconsole.dir(results); // result-documents are now sorted\n\nisRxQuery\nReturns true if the given object is an instance of RxQuery. Returns false if not.\nconst is = RxDB.isRxQuery(myObj);\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-attachment.html":{"url":"rx-attachment.html","title":"RxAttachment","keywords":"","body":"Attachments\nLike pouchdb, RxDB can store attachments which has a better performance and a higher quota-limit then regular data.\nYou can store string, binary files, images and whatever you want side by side with your documents.\nBefore you can use attachments, you have to ensure that the attachments-object is set in the schema of your RxCollection.\n\nconst mySchema = {\n version: 0,\n type: 'object',\n properties: {\n // .\n // .\n // .\n },\n attachments: {\n encrypted: true // if true, the attachment-data will be encrypted with the db-password\n }\n};\n\nconst myCollection = await myDatabase.collection({\n name: 'humans',\n schema: mySchema\n});\n\nputAttachment()\nAdds an attachment to a RxDocument. Returns a Promise with the new attachment.\nconst attachment = await myDocument.putAttachment({\n id, // string, name of the attachment like 'cat.jpg'\n data, // (string|Blob|Buffer) data of the attachment\n type // (string) type of the attachment-data like 'image/jpeg'\n});\n\ngetAttachment()\nReturns an RxAttachment by its id. Returns null when the attachment does not exist.\nconst attachment = myDocument.getAttachment('cat.jpg');\n\nallAttachments()\nReturns an array of all attachments of the RxDocument.\nconst attachments = myDocument.allAttachments();\n\nallAttachments$\nGets an Observable which emits a stream of all attachments from the document. Re-emits each time an attachment gets added or removed from the RxDocument.\nconst all = [];\nmyDocument.allAttachments$.subscribe(\n attachments => all = attachments\n);\n\nRxAttachment\nThe attachments of RxDB are represented by the type RxAttachment which has the following attributes/methods.\ndoc\nThe RxDocument which the attachment is assigned to.\nid\nThe id as string of the attachment.\ntype\nThe type as string of the attachment.\nlength\nThe length of the data of the attachment as number.\ndigest\nThe md5-sum of the attachments data as string.\nrev\nThe revision-number of the attachment as number.\nremove()\nRemoves the attachment. Returns a Promise that resolves when done.\nconst attachment = myDocument.getAttachment('cat.jpg');\nawait attachment.remove();\n\ngetData()\nReturns a Promise which resolves the attachment's data as Blob or Buffer. (async)\nconst attachment = myDocument.getAttachment('cat.jpg');\nconst blobBuffer = await attachment.getData();\n\ngetStringData()\nReturns a Promise which resolves the attachment's data as string.\nconst attachment = await myDocument.getAttachment('cat.jpg');\nconst data = await attachment.getStringData();\n\n\nIf you are new to RxDB, you should continue here\n"},"middleware.html":{"url":"middleware.html","title":"Middleware-hooks","keywords":"","body":"Middleware\nRxDB supports middleware-hooks like mongoose.\nMiddleware (also called pre and post hooks) are functions which are passed control during execution of asynchronous functions.\nThe hooks are specified on RxCollection-level and help to create a clear what-happens-when-structure of your code.\nHooks can be defined to run parallel or as series one after another.\nHooks can be synchronous or asynchronous when they return a Promise.\nTo stop the operation at a specific hook, throw an error.\nList\nRxDB supports the following hooks:\n\npreInsert\npostInsert\npreSave\npostSave\npreRemove\npostRemove\npostCreate\n\nWhy is there no validate-hook?\nDifferent to mongoose, the validation on document-data is running on the field-level for every change to a document.\nThis means if you set the value lastName of a RxDocument, then the validation will only run on the changed field, not the whole document.\nTherefore it is not useful to have validate-hooks when a document is written to the database.\nUse Cases\nMiddleware are useful for atomizing model logic and avoiding nested blocks of async code.\nHere are some other ideas:\n\ncomplex validation\nremoving dependent documents\nasynchronous defaults\nasynchronous tasks that a certain action triggers\ntriggering custom events\nnotifications\n\nUsage\nInsert\nAn insert-hook receives the data-object of the new document.\nlifecycle\n\nRxCollection.insert is called\npreInsert series-hooks\npreInsert parallel-hooks\nschema validation runs\nnew document is written to database\npostInsert series-hooks\npostInsert parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreInsert\n// series\nmyCollection.preInsert(function(documentData){\n\n}, false);\n\n// parallel\nmyCollection.preInsert(function(documentData){\n\n}, true);\n\n// async\nmyCollection.preInsert(function(documentData){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the insert-operation\nmyCollection.preInsert(function(documentData){\n throw new Error('stop');\n}, false);\n\npostInsert\n// series\nmyCollection.postInsert(function(documentData){\n\n}, false);\n\n// parallel\nmyCollection.postInsert(function(documentData){\n\n}, true);\n\n// async\nmyCollection.postInsert(function(documentData){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\nSave\nA save-hook receives the document which is saved.\nlifecycle\n\nRxDocument.save is called\npreSave series-hooks\npreSave parallel-hooks\nupdated document is written to database\npostSave series-hooks\npostSave parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreSave\n// series\nmyCollection.preSave(function(doc){\n doc.anyField = 'anyValue';\n}, false);\n\n// parallel\nmyCollection.preSave(function(doc){\n\n}, true);\n\n// async\nmyCollection.preSave(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the save-operation\nmyCollection.preSave(function(doc){\n throw new Error('stop');\n}, false);\n\npostSave\n// series\nmyCollection.postSave(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.postSave(function(doc){\n\n}, true);\n\n// async\nmyCollection.postSave(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\nRemove\nAn remove-hook receives the document which is removed.\nlifecycle\n\nRxDocument.remove is called\npreRemove series-hooks\npreRemove parallel-hooks\ndeleted document is written to database\npostRemove series-hooks\npostRemove parallel-hooks\nevent is emitted to RxDatabase and RxCollection\n\npreSave\n// series\nmyCollection.preRemove(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.preRemove(function(doc){\n\n}, true);\n\n// async\nmyCollection.preRemove(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\n// stop the remove-operation\nmyCollection.preRemove(function(doc){\n throw new Error('stop');\n}, false);\n\npostRemove\n// series\nmyCollection.postRemove(function(doc){\n\n}, false);\n\n// parallel\nmyCollection.postRemove(function(doc){\n\n}, true);\n\n// async\nmyCollection.postRemove(function(doc){\n return new Promise(res => setTimeout(res, 100));\n}, false);\n\npostCreate\nThis hook is called whenever a RxDocument is constructed.\nYou can use postCreate to modify every RxDocument-instance of the collection.\nThis adds a flexible way to add specify behavior to every document. You can also use it to add custom getter/setter to documents. PostCreate-hooks cannot be asynchronous.\nmyCollection.postCreate(function(doc){\n Object.defineProperty(doc, 'myField', {\n get: () => 'foobar',\n });\n});\n\nconst doc = await myCollection.findOne().exec();\n\nconsole.log(doc.myField);\n// 'foobar'\n\nNotice: This hook does not run on already created or cached documents. Make sure to add postCreate-hooks before interacting with the collection.\n\nIf you are new to RxDB, you should continue here\n"},"orm.html":{"url":"orm.html","title":"ORM/DRM","keywords":"","body":"Object-Data-Relational-Mapping\nLike mongoose, RxDB has ORM-capabilities which can be used to add specific behavior to documents and collections.\nstatics\nStatics are defined collection-wide and can be called on the collection.\nAdd statics to a collection\nTo add static functions, pass a statics-object when you create your collection. The object contains functions, mapped to their function-names.\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n statics: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\n\nconsole.log(heroes.scream());\n// 'AAAH!!'\n\nYou can also use the this-keyword which resolves to the collection:\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n statics: {\n whoAmI: function(){\n this.name;\n }\n }\n});\nconsole.log(heroes.whoAmI());\n// 'heroes'\n\ninstance-methods\nInstance-methods are defined collection-wide. They can be called on the RxDocuments of the collection.\nAdd instance-methods to a collection\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n methods: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\nconst doc = await heroes.findOne().exec();\nconsole.log(doc.scream());\n// 'AAAH!!'\n\nHere you can also use the this-keyword:\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n methods: {\n whoAmI: function(){\n return 'I am ' + this.name + '!!';\n }\n }\n});\nawait heroes.insert({\n name: 'Skeletor'\n});\nconst doc = await heroes.findOne().exec();\nconsole.log(doc.whoAmI());\n// 'I am Skeletor!!'\n\nattachment-methods\nAttachment-methods are defined collection-wide. They can be called on the RxAttachemnts of the RxDocuments of the collection.\nconst heroes = await myDatabase.collection({\n name: 'heroes',\n schema: mySchema,\n attachments: {\n scream: function(){\n return 'AAAH!!';\n }\n }\n});\nconst doc = await heroes.findOne().exec();\nconst attachment = await doc.putAttachment({\n id: 'cat.txt',\n data: 'meow I am a kitty',\n type: 'text/plain'\n});\nconsole.log(attachment.scream());\n// 'AAAH!!'\n\n\nIf you are new to RxDB, you should continue here\n"},"population.html":{"url":"population.html","title":"Population","keywords":"","body":"Population\nThere are no joins in RxDB but sometimes we still want references to documents in other collections. This is where population comes in. You can specify a relation from one RxDocument to another RxDocument in the same or another RxCollection of the same database.\nThen you can get the referenced document with the population-getter.\nThis works exactly like population with mongoose.\nSchema with ref\nThe ref-keyword describes to which collection the field-value belongs to.\nexport const refHuman = {\n title: 'human related to other human',\n version: 0,\n properties: {\n name: {\n primary: true,\n type: 'string'\n },\n bestFriend: {\n ref: 'human', // refers to collection human\n type: 'string' // ref-values must always be string (primary of foreign RxDocument)\n }\n }\n};\n\npopulate()\nvia method\nTo get the referred RxDocument, you can use the populate()-method.\nIt takes the field-path as attribute and returns a Promise which resolves to the foreign document or null if not found.\nawait humansCollection.insert({\n name: 'Alice',\n bestFriend: 'Carol'\n});\nawait humansCollection.insert({\n name: 'Bob',\n bestFriend: 'Alice'\n});\nconst doc = await humansCollection.findOne('Bob').exec();\nconst bestFriend = await doc.populate('bestFriend');\nconsole.dir(bestFriend); //> RxDocument[Alice]\n\nvia getter\nYou can also get the populated RxDocument with the direct getter. Therefore you have to add an underscore suffix _ to the fieldname.\nThis works also on nested values.\nawait humansCollection.insert({\n name: 'Alice',\n bestFriend: 'Carol'\n});\nawait humansCollection.insert({\n name: 'Bob',\n bestFriend: 'Alice'\n});\nconst doc = await humansCollection.findOne('Bob').exec();\nconst bestFriend = await doc.bestFriend_; // notice the underscore_\nconsole.dir(bestFriend); //> RxDocument[Alice]\n\nExample with nested reference\nconst myCollection = await myDatabase.collection({\n name: 'human',\n schema: {\n version: 0,\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n family: {\n type: 'object',\n properties: {\n mother: {\n type: 'string',\n ref: 'human'\n }\n }\n }\n }\n }\n});\n\nconst mother = await myDocument.family.mother_;\nconsole.dir(mother); //> RxDocument\n\nExample with array\nconst myCollection = await myDatabase.collection({\n name: 'human',\n schema: {\n version: 0,\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n friends: {\n type: 'array',\n ref: 'human',\n items: {\n type: 'string'\n }\n }\n }\n }\n});\n\n//[insert other humans here]\n\nawait myCollection.insert({\n name: 'Alice',\n friends: [\n 'Bob',\n 'Carol',\n 'Dave'\n ]\n});\n\nconst doc = await humansCollection.findOne('Alice').exec();\nconst friends = await myDocument.friends_;\nconsole.dir(friends); //> Array.\n\n\nIf you are new to RxDB, you should continue here\n"},"data-migration.html":{"url":"data-migration.html","title":"DataMigration","keywords":"","body":"DataMigration\nImagine you have your awesome messenger-app distributed to many users. After a while, you decide that in your new version, you want to change the schema of the messages-collection. Instead of saving the message-date like 2017-02-12T23:03:05+00:00 you want to have the unix-timestamp like 1486940585 to make it easier to compare dates. To accomplish this, you change the schema and increase the version-number and you also change your code where you save the incoming messages. But one problem remains: what happens with the messages which are already saved on the user's device in the old schema?\nWith RxDB you can provide migrationStrategies for your collections that automatically (or on call) transform your existing data from older to newer schemas. This assures that the client's data always matches your newest code-version.\nProviding strategies\nUpon creation of a collection, you have to provide migrationStrategies when your schema's version-number is greater than 0. To do this, you have to add an object to the migrationStrategies property where a function for every schema-version is assigned. A migrationStrategy is a function which gets the old document-data as a parameter and returns the new, transformed document-data. If the strategy returns null, the document will be removed instead of migrated.\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n // 1 means, this transforms data from version 0 to version 1\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n }\n }\n});\n\nAsynchronous strategies can also be used:\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n },\n /**\n * 2 means, this transforms data from version 1 to version 2\n * this returns a promise which resolves with the new document-data\n */\n 2: function(oldDoc){\n // in the new schema (version: 2) we defined 'senderCountry' as required field (string)\n // so we must get the country of the message-sender from the server\n const coordinates = oldDoc.coordinates;\n return fetch('http://myserver.com/api/countryByCoordinates/'+coordinates+'/')\n .then(response => {\n const response = response.json();\n oldDoc.senderCountry=response;\n return oldDoc;\n });\n }\n }\n});\n\nyou can also filter which documents should be migrated:\nmyDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n migrationStrategies: {\n // 1 means, this transforms data from version 0 to version 1\n 1: function(oldDoc){\n oldDoc.time = new Date(oldDoc.time).getTime(); // string to unix\n return oldDoc;\n },\n /**\n * this removes all documents older then 2017-02-12\n * they will not appear in the new collection\n */\n 2: function(oldDoc){\n if(oldDoc.time \nautoMigrate\nBy default, the migration automatically happens when the collection is created. If you have lots of data or the migrationStrategies take a long time, it might be better to start the migration 'by hand' and show the migration-state to the user as a loading-bar.\nconst messageCol = await myDatabase.collection({\n name: 'messages',\n schema: messageSchemaV1,\n autoMigrate: false, // console.dir(state),\n error => console.error(error),\n done => console.log('done')\n);\n\n// the emitted states look like this:\n{\n done: false, // true if finished\n total: 50, // amount of documents which must be migrated\n handled: 0, // amount of handled docs\n success: 0, // handled docs which succeeded\n deleted: 0, // handled docs which got deleted\n percent: 0 // percentage\n}\n\nIf you don't want to show the state to the user, you can also use .migratePromise():\n const migrationPromise = messageCol.migratePromise(10);\n await migratePromise;\n\nHint\nIf your migration takes a long time, combine it with the leaderElection to make sure you don't waste your users' resources by running it in 2 open tabs.\n\nIf you are new to RxDB, you should continue here\n"},"leader-election.html":{"url":"leader-election.html","title":"LeaderElection","keywords":"","body":"Leader-Election\nBefore you read this, please check out on how many of your open browser-tabs you have opened the same website more than once. Count them, I will wait..\nSo if you would now inspect the traffic that theses open tabs produce, you can see that many of them send exact the same data over wire for every tab. No matter if the data is sent with an open websocket or by polling.\nUse-case-example\nImagine we have a website which displays the current temperature of the visitors location in various charts, numbers or heatmaps. To always display the live-data, the website opens a websocket to our API-Server which sends the current temperature every 10 seconds. Using the way most sites are currently build, we can now open it in 5 browser-tabs and it will open 5 websockets which send data 6*5=30 times per minute. This will not only waste the power of your clients device, but also wastes your api-servers resources by opening redundant connections.\nSolution\nThe solution to this redundancy is the usage of a leader-election-algorithm which makes sure that always exactly one tab is managing the remote-data-access. The managing tab is the elected leader and stays leader until it is closed. No matter how many tabs are opened or closed, there must be always exactly one leader.\nYou could now start implementing a messaging-system between your browser-tabs, hand out which one is leader, solve conflicts and reassign a new leader when the old one 'dies'.\nOr just use RxDB which does all these things for you.\nCode-example\nTo make it easy, here is an example where the temperature is pulled every ten seconds and saved to a collection. The pulling starts at the moment where the opened tab becomes the leader.\nconst db = await RxDB.create({\n name: 'weatherDB',\n adapter: 'localstorage',\n password: 'myPassword',\n multiInstance: true\n});\nawait db.collection({\n name: 'temperature',\n schema: mySchema\n});\n\ndb.waitForLeadership()\n .then(() => {\n console.log('Long lives the king!'); // {\n const temp = await fetch('https://example.com/api/temp/');\n db.temperature.insert({\n degrees: temp,\n time: new Date().getTime()\n });\n }, 1000 * 10);\n });\n\nLive-Example\nIn this example the leader is marked with the crown ♛\n\nTry it out\nRun the vanillaJS-example where the leading tab is marked with a crown on the top-right-corner.\n\nIf you are new to RxDB, you should continue here\n"},"replication.html":{"url":"replication.html","title":"Replication","keywords":"","body":"Replication\nOne of the most powerful features with CouchDB, PouchDB and RxDB is sync.\nYou can sync every RxCollection with another RxCollection, a PouchDB-instance or a remote pouch/couch-DB.\nRx.Collection.sync()\nTo replicate the collection with another instance, use RxCollection.sync().\nIt basically does the same as pouchdb-sync but also adds event-handlers to make sure that change-events will be recognized in the internal event-stream.\n\n// you need these plugins to sync\nRxDB.plugin(require('pouchdb-adapter-http')); // enable syncing over http (remote database)\n\nconst replicationState = myCollection.sync(\n remote: 'http://localhost:10102/db/', // remote database. This can be the serverURL, another RxCollection or a PouchDB-instance\n waitForLeadership: true, // (optional) [default=true] to save performance, the sync starts on leader-instance only\n direction: { // direction (optional) to specify sync-directions\n pull: true, // default=true\n push: true // default=true\n },\n options: { // sync-options (optional) from https://pouchdb.com/api.html#replication\n live: true,\n retry: true\n },\n query: myCollection.find().where('age').gt(18) // query (optional) only documents that match that query will be synchronised\n);\n\nRxReplicationState\nThe method RxCollection.sync() returns a RxReplicationState which can be used to observe events via rxjs-observables and to cancel the replication.\nchange$\nEmits the change-events every time some documents get replicated.\nreplicationState.change$.subscribe(change => console.dir(change));\n\ndocs$\nEmits each replicated document-data.\nreplicationState.docs$.subscribe(docData => console.dir(docData));\n\nactive$\nEmits true or false depending if the replication is running. For example if you sync with a remote server and the connection dies, this is false until the connection can be reestablished.\nreplicationState.active$.subscribe(active => console.dir(active));\n\ncomplete$\nEmits true or false depending if the replication is completed.\nIf you do a live: true-sync (default) the replication never completes.\nOnly one-time-replications will complete.\nreplicationState.complete$.subscribe(completed => console.dir(completed));\n\nerror$\nIf errors occur during the replication, they will get emitted here.\nreplicationState.error$.subscribe(error => console.dir(error));\n\ncancel()\nCalling this method will cancel the replication.\nawait replicationState.cancel(); // cancel() is async\n\n\nIf you are new to RxDB, you should continue here\n"},"query-change-detection.html":{"url":"query-change-detection.html","title":"QueryChangeDetection","keywords":"","body":"QueryChangeDetection\nSimilar to Meteors oplog-observe-driver,\nRxDB has a QueryChangeDetection to optimize observed or reused queries. This makes sure that when you update/insert/remove documents, the query does not have to re-run over the whole database but the new results will be calculated from the events. This creates a huge performance gain with zero cost.\nNOTICE:\nQueryChangeDetection is currently in beta and disabled by default.\nYou can enable it by calling the enable()-function on its module.\nimport { QueryChangeDetector } from 'rxdb';\nQueryChangeDetector.enable();\nQueryChangeDetector.enableDebugging(); // shows a console.log everytime an optimisation is made\n\nUse-case-example\nImagine you have a very big collection with many user-documents. At your page you want to display a toplist with users which have the most points and are currently logged in.\nYou create a query and subscribe to it.\nconst query = usersCollection.find().where('loggedIn').eq(true).sort('points');\nquery.$.subscribe(users => {\n document.querySelector('body').innerHTML = users\n .reduce((prev, cur) => prev + cur.username+ '', '');\n});\n\nAs you may detect, the query can take a very long time to run because you have thousands of users in the collection.\nThen, when a user logs off, the whole query will re-run over the database which takes a really long time yet again.\nanyUser.loggedIn = false;\nawait anyUser.save();\n\nBut not with QueryChangeDetection enabled.\nNow, when one user logs off, it will calculate the new results from the current results plus the RxChangeEvent. This can often be done in-memory without making IO-requests to the storage-engine. QueryChangeDetection not only works on subscribed queries, but also when you do multiple .exec()'s on the same query.\n\nIf you are new to RxDB, you should continue here\n"},"in-memory.html":{"url":"in-memory.html","title":"InMemory","keywords":"","body":"in-memory\nWhen you do a heavy amount of operations on a RxCollection, you might want to optimize this by using the in-memory-replication of the collection. The in-memory-replication behaves equal to the original collection but is stored in the Ram of your computer.\nRxCollection().inMemory();\nReturns a promise that resolves with another RxCollection that is the in-memory-replicated version of the original collection. The memory-collection has the same documents as it's parent and also shares the same event-stream.\n\n// IMPORTANT: You have to add the memory-adapter before you can use inMemory-Collections\n// RUN 'npm install pouchdb-adapter-memory --save'\nimport PouchAdapterMemory from 'pouchdb-adapter-memory';\nRxDB.plugin(PouchAdapterMemory);\n\nconst memCol = await myCollection.inMemory();\n\n// now u can use memCol as it would be myCollection\nconst docs = await memCol.find().exec(); // has same result as on the original collection\n\nencryption\nEncrypted fields are automatically decrypted inside of the memory-collection. This means you can do queries over encrypted fields.\nreplication\nThe memory-collection is two-way-replicated with its original collection. This means when you change documents on one of them, the update and the change-event will fire on both.\nPros:\n\nFaster queries\nFaster writes\nQuerying works over encrypted fields\n\nCons:\n\nThe original collection has to be small enough to fit into the memory\nNo attachment-support\nInitial creation takes longer (all data is loaded from disc into the memory)\n\n\nIf you are new to RxDB, you should continue here\n"},"rx-local-document.html":{"url":"rx-local-document.html","title":"LocalDocuments","keywords":"","body":"Local Documents\nLocal documents are a special class of documents which are used to store local metadata.\nThey come in handy when you want to store settings or additional data next to your documents.\n\nLocal Documents can exist on RxDatabase or RxCollection\nLocal Document do not have to match the collections schema\nLocal Documents do not get replicated\nLocal Documents will not be found on queries\nLocal Documents can not have attachments\nLocal Documents will not get handled by the data-migration\n\ninsertLocal()\nCreates a local document for the database or collection. Throws if a local document with the same id already exists. Returns a Promise which resolves the new RxLocalDocument.\nconst localDoc = await myCollection.insertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\n// you can also use local-documents on a database\nconst localDoc = await myDatabase.insertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\nupsertLocal()\nCreates a local document for the database or collection if not exists. Overwrites the if exists. Returns a Promise which resolves the RxLocalDocument.\nconst localDoc = await myCollection.upsertLocal(\n 'foobar', // id\n { // data\n foo: 'bar'\n }\n);\n\ngetLocal()\nFind a RxLocalDocument by it's id. Returns a Promise which resolves the RxLocalDocument or null if not exists.\nconst localDoc = await myCollection.getLocal('foobar');\n\nRxLocalDocument\nA RxLocalDocument behaves like a normal RxDocument.\nconst localDoc = await myCollection.getLocal('foobar');\n\n// access data\nconst foo = localDoc.get('foo');\n\n// change data\nlocalDoc.set('foo', 'bar2');\nawait localDoc.save();\n\n// observe data\nlocalDoc.get$('foo').subscribe(value => { /* .. */ });\n\n// remove it\nawait localDoc.remove();\n\nNOTICE: Because the local document does not have a schema, accessing the documents data-fields via pseudo-proxy will not work.\nconst foo = localDoc.foo; // undefined\nconst foo = localDoc.get('foo'); // works!\n\nlocalDoc.foo = 'bar'; // does not work!\nlocalDoc.set('foo', 'bar'); // works\n\n\nIf you are new to RxDB, you should continue here\n"},"custom-build.html":{"url":"custom-build.html","title":"Custom Build","keywords":"","body":"Custom Build\nBy default, if you import RxDB into your javascript, a full batteries-included build will be imported. This has the advantage that you don't have to choose which things you need and which not. The disadvantage is the build-size. Often you don't need most of the functionality and you could save a lot of bandwidth by cherry-picking only the things you really need. For this, RxDB supports custom builds.\nCore\nThe core-module is the part of RxDB which is always needed to provide basic functionality. If you need a custom build, you start with the core and then add all modules that you need.\n// es6-import\nimport RxDB from 'rxdb/plugins/core';\n\n// es5-require\nconst RxDB = require('rxdb/plugins/core');\n\nrequired modules\nSome parts of RxDB are not in the core, but are required. This means they must always be overwrite by at least one plugin.\nvalidate\nThe validation-module does the schema-validation when you insert or update a RxDocument. To use RxDB you always have to add a validation-module.\nThis one is using is-my-json-valid but you can also use your own validator instead. To import the default validation-module, do this:\n// es6-import\nimport RxDBValidateModule from 'rxdb/plugins/validate';\nRxDB.plugin(RxDBValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/validate'));\n\najv-validate\nAnother validation-module that does the schema-validation. This one is using ajv as validator which is a bit faster. Better compliant to the jsonschema-standart but also has a bigger build-size.\n// es6-import\nimport RxDBAjvValidateModule from 'rxdb/plugins/ajv-validate';\nRxDB.plugin(RxDBAjvValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/ajv-validate'));\n\nno-validate\nA validation module that does nothing at handles all data as valid. Use this as an alternative for the normal validator when you can rely on the input of the database.\nThis is meant for production to reduce the build-size, do not use this in dev-mode.\n// es6-import\nimport RxDBNoValidateModule from 'rxdb/plugins/no-validate';\nRxDB.plugin(RxDBNoValidateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/no-validate'));\n\noptional modules\nSome modules are optional and only needed if you use their functionality.\nerror-messages\nBecause error-messages are hard to compress, RxDB will throw error-codes by default. In development you should always include this plugin so full messages will be thrown.\n// es6-import\nimport RxDBErrorMessagesModule from 'rxdb/plugins/error-messages';\nRxDB.plugin(RxDBSchemaCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/error-messages'));\n\nschema-check\nThe schemacheck-module does additional checks on your jsonschema before you create a RxCollection. This ensure that your collection-schema is correctly working with rxdb. You should always enable this plugin on dev-mode.\n// es6-import\nimport RxDBSchemaCheckModule from 'rxdb/plugins/schema-check';\nRxDB.plugin(RxDBSchemaCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/schema-check'));\n\nreplication\nAdds the replication-functionality to RxDB.\n// es6-import\nimport RxDBReplicationModule from 'rxdb/plugins/replication';\nRxDB.plugin(RxDBReplicationModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/replication'));\n\nattachments\nAdds the attachments-functionality to RxDB.\n// es6-import\nimport RxDBAttachmentsModule from 'rxdb/plugins/attachments';\nRxDB.plugin(RxDBAttachmentsModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/attachments'));\n\nin-memory\nAdds the in-memory-replication to the collections.\n// es6-import\nimport RxDBInMemoryModule from 'rxdb/plugins/in-memory';\nRxDB.plugin(RxDBInMemoryModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/in-memory'));\n\nlocal-documents\nAdds the local-documents to the collections and databases.\n// es6-import\nimport RxDBLocalDocumentsModule from 'rxdb/plugins/local-documents';\nRxDB.plugin(RxDBLocalDocumentsModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/local-documents'));\n\njson-dump\nAdds the json import/export-functionality to RxDB.\n// es6-import\nimport RxDBJsonDumpModule from 'rxdb/plugins/json-dump';\nRxDB.plugin(RxDBJsonDumpModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/json-dump'));\n\nkey-compression\nThe keycompressor-module is needed when you have keyCompression enabled. This is done by default so make sure that you set disableKeyCompression to true when you do not have this module.\n// es6-import\nimport RxDBKeyCompressionModule from 'rxdb/plugins/key-compression';\nRxDB.plugin(RxDBKeyCompressionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/key-compression'));\n\nleader-election\nThe leaderelection-module is needed when want to use the leaderelection.\n// es6-import\nimport RxDBLeaderElectionModule from 'rxdb/plugins/leader-election';\nRxDB.plugin(RxDBLeaderElectionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/leader-election'));\n\nencryption\nThe encryption-module is using crypto-js and is only needed when you create your RxDB-Database with a password.\n// es6-import\nimport RxDBEncryptionModule from 'rxdb/plugins/encryption';\nRxDB.plugin(RxDBEncryptionModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/encryption'));\n\nupdate\nThe update-module is only required when you use RxDocument.update or RxQuery.update.\n// es6-import\nimport RxDBUpdateModule from 'rxdb/plugins/update';\nRxDB.plugin(RxDBUpdateModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/update'));\n\nadapter-check\nThis module add the checkAdapter-function to RxDB.\n// es6-import\nimport RxDBAdapterCheckModule from 'rxdb/plugins/adapter-check';\nRxDB.plugin(RxDBAdapterCheckModule);\n\n// es5-require\nRxDB.plugin(require('rxdb/plugins/adapter-check'));\n\n\nIf you are new to RxDB, you should continue here\n"},"plugins.html":{"url":"plugins.html","title":"Plugins","keywords":"","body":"Plugins\nCreating an own plugin is very simple. A plugin is basically an javascript-object which overwrites or extends RxDB's internal classes, prototypes and hooks.\nA basic plugins:\n\nconst myPlugin = {\n rxdb: true, // this must be true so rxdb knows that this is a rxdb-plugin and not a pouchdb-plugin\n /**\n * every value in this object can manipulate the prototype of the keynames class\n * You can manipulate every prototype in this list:\n * @link https://github.com/pubkey/rxdb/blob/cutsom-builds/src/Plugin.js\n */\n prototypes: {\n /**\n * add a function to RxCollection so you can call 'myCollection.hello()'\n *\n * @param {object} prototype of RxCollection\n */\n RxCollection: (proto) => {\n proto.hello = function(){\n return 'world';\n };\n }\n },\n /**\n * some methods are static and can be overwritten in the overwriteable-object\n */\n overwritable: {\n validatePassword: function(password) {\n if (password && typeof password !== 'string' || password.length \nProperties\nrxdb\nThe rxdb-property signals that this plugin is and rxdb-plugin and not a pouchdb-plugin. The value should always be true.\nprototypes\nThe prototypes-property contains a function for each of RxDB's internal prototype that you want to manipulate. Each function gets the prototype-object of the corresponding class as parameter and than can modify it. You can see a list of all available prototypes here\noverwritable\nSome of RxDB's functions are not inside of a class-prototype but are static. You can set and overwrite them with the overwritable-object. You can see a list of all overwriteables here.\nhooks\nSometimes you don't want to overwrite an existing RxDB-method, but extend it. You can do this by adding hooks which will be called each time the code jumps into the hooks corresponding call. You can find a list of all hooks here here.\noptions\nRxDatabase and RxCollection have an additional options-parameter, which can be filled with any data required be the plugin.\nconst collection = myDatabase.collection({\n name: 'foo'.\n schema: mySchema,\n options: { // anything can be passed into the options\n foo: ()=>'bar'\n }\n})\n\n// Afterwards you can use theses options in your plugin.\n\ncollection.options.foo(); // 'bar'\n\n\nIf you are new to RxDB, you should continue here\n"},"contribute.html":{"url":"contribute.html","title":"Contribute","keywords":"","body":"Contribution\nWe are open to, and grateful for, any contributions made by the community.\nDeveloping\nRequirements\nBefore you can start developing, do the following:\n\nMake sure you have installed nodejs with version 7 or higher\nClone the repository git clone https://github.com/pubkey/rxdb.git\nInstall the dependencies cd rxdb && npm install\nMake sure that the tests work for you npm run test\n\nFlow\nWhile developing you should run npm run dev and leave it open in the console. This will run the unit-tests on every file-change. If you have a slow device, you can also manually run npm run test:node every time you want to check if the tests work.\nAdding tests\nBefore you start creating a bugfix or a feature, you should create a test to reproduce it. Tests are in the test/unit-folder.\nIf you want to reproduce a bug, you can modify the test in this file.\nMaking a PR\nIf you make a pull-request, ensure the following:\n\nEvery feature or bugfix must be committed together with a unit-test which ensures everything works as expected.\nDo not commit build-files (anything in the dist-folder)\nBefore you add non-trivial changes, create an issue to discuss if this will be merged and you don't waste your time.\nTo run the unit and integration-tests, do npm run test and ensure everything works as expected\n\nGetting help\nIf you need help with your contribution, ask at gitter.\nDocs\nThe source of the documentation is at the docs-src-folder.\nTo read the docs locally, run npm run docs docs:install && npm run docs:serve and open http://localhost:4000/\nThank you for contributing!\n"}}} \ No newline at end of file diff --git a/package.json b/package.json index 7314be41c7d..9182f9505c2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rxdb", "description": "Offline-first database with Reactive, Sync, Schema, Promises, Mongo-Query, Encryption, LevelDown", - "version": "7.3.1", + "version": "7.3.2", "author": "pubkey", "repository": { "type": "git",