我正在使用 PouchDB 同步到我的服务器上的本地 CouchDb,我尝试从我的笔记本电脑同步一个 couchdb。
我的 .ts 文件中的代码如下:
var localDB = new PouchDB('mylocaldb')
var remoteDB = new PouchDB('http://localhost:5984/easy_water')
localDB.sync(remoteDB, {
live: false,
retry: false
}).on('change', function (change) {
console.log(change);
}).on('paused', function (info) {
console.log(JSON.stringify(info));
}).on('error', function (err) {
console.log(err);
});
console.log("fertig");
浏览器中的结果是:
fertig
undefined
undefined
remoteDatabase 存在,所以 remoteDatabase 没有错