db.replicate.to('http://example.com/mydb');
IMHO, should be db.replicate(to: 'http://example.com/mydb'); db.replicate.to('http://example.com/mydb');
IMHO, should be db.replicate(to: 'http://example.com/mydb'); db.replicate
.from('http://example.com/mydb1')
.to('http://example.com/mydb2')
.on('complete', function() {
})
.on('error', function() {
})
.then(function() {
});Unless Pouch has anything required missing I think it's fine though maybe a little unintuitive (like can you do multiple froms? Multiple tos? Etc)
db.replicate
.from('http://example.com/mydb1')
or db.replicate
.from('http://example.com/mydb1')
.from('http://example.com/mydb2')
.to('http://example.com/mydb3')
or db.replicate
.from('http://example.com/mydb1')
.to('http://example.com/mydb2')
.to('http://example.com/mydb3')
? serious questionreplicates from mydb1 into the pouchdb object represented by 'db'
2 & 3:
I'm pretty sure chaining replications doesn't work in that way, although thats a pretty interesting thought.
If you have to chain replications and achieve the structure in 2, you'd have to define the pouch objects as:
db = new PouchDB('localDB');
mydb1 = new PouchDB('http://example.com/mydb1');
etc ..
and then do:
mydb2.replicate.to('mydb3',{live:true});
mydb2.replicate.to('mydb1',{live:true});
mydb1.replicate.to('db',{live:true});
the 'live' flag, as you'd imagine, makes the replication live/continuous, as opposed to one-time.
db.replicate.to_stdout('http://example.com/mydb');