Hacker News new | past | comments | ask | show | jobs | submit login

What happens when you do:

  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 question



1: replicates 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: