2017-01-23 11 views

答えて

2

をあなたはすべてのクライアントデータベースのCouchDBの中でフィルタを作成したフィルタ

  1. でレプリケーションを行う必要があります。すべてのクライアント・データベースのためのクライアントからのCouchDBのすべての文書のためのフィルタによるクライアントへ
  2. のCouchDBからスタートreplicationフィルタという名前のレプリケーション・オプションを見て)
  3. のレプリケーションを開始。

あなたはこれが正しいhere(例3、4)

2

複数のPouchDBインスタンスを作成する場合は、それぞれのPouchDBインスタンスにそれぞれのリスナーを作成して、必要なリモートDB(問題のCouchDB)を指定する必要があります。リスナーの

この例では、私の仕事:

var sync = PouchDB.sync('mydb', 'http://localhost:5984/mydb', { 
 
    live: true, 
 
    retry: true 
 
}).on('change', function (info) { 
 
    // handle change 
 
}).on('paused', function (err) { 
 
    // replication paused (e.g. replication up to date, user went offline) 
 
}).on('active', function() { 
 
    // replicate resumed (e.g. new changes replicating, user went back online) 
 
}).on('denied', function (err) { 
 
    // a document failed to replicate (e.g. due to permissions) 
 
}).on('complete', function (info) { 
 
    // handle complete 
 
}).on('error', function (err) { 
 
    // handle error 
 
});

+0

が必要なすべてを見つけることができます。また、複数のPouchDBからインメモリーPouchDBに同期し、そのPouchDBからサーバーに同期することもできます。 – nlawson

関連する問題