I am using pouchdb in my electron app,I have more than 15 database in my app. my problem is when i sync one or two database to couchdb it works great,but more than 3 couchdb doesn't sync.
My code :
var sync = PouchDB.sync('mydb', 'http://localhost:5984/mydb', {
live: true,
retry: true
})
I am also tried without live but it increase program complexity,however I manually want to place the code while perform insert,delete, update operations.
Can pouchdb watch put,update,delete events? To perform manual sync instead live
How should I achieve?
How to properly sync multiple database?
Which one I choose live sync or manual sync?
Is pouchdb fit for multiple database sync?
don't use database with live sync instead use manual sync with callback
problems:
solutions
code
function sync(){
setTimeout(function() {
var sync = PouchDB.sync('db1', 'http://localhost:5984/db1')
.on('complete', (info) => {
PouchDB.sync('db2', 'http://localhost:5984/db2')
.on('complete', (info) => {
sync()
});
});
},1000)
}