Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make this work between two PouchDBs #24

Open
BigBlueHat opened this issue Mar 4, 2016 · 2 comments
Open

Make this work between two PouchDBs #24

BigBlueHat opened this issue Mar 4, 2016 · 2 comments

Comments

@BigBlueHat
Copy link

It's not dissimilar to this approach using transform-pouch: http://stackoverflow.com/a/35805152/507169

However, it'd be handy to do this with a single command. Maybe:

dbA.migrateTo(dbB, function(doc) {
  if ('foo' in doc) return

  doc.foo = 'bar'
  return [doc]
}).then(...);

Maybe it's already possible and I just missed something. 😉

Thanks for making so much awesomeness!
🎩

@jo
Copy link
Contributor

jo commented Mar 8, 2016

Yes, this is a good idea and might be very useful.

Its not possible atm but I think it won't require that much work. I'd happily accept a pull :)

@stuartpb
Copy link

stuartpb commented Dec 1, 2016

I was just thinking about this in pouchdb-community/transform-pouch#37 and pouchdb-community/transform-pouch#38, and I think, unless I'm missing something, it's significantly dissimilar to an incoming transformation on migration.

A migration using this plugin will (I'm assuming) perform several put operations to update, each of which creates a new revision of the document that will be reflected if and when the database receiving the migration is replicated back to the original database (and, of course, with this, the migrations will be present in the original database - one of the reasons one would want to do migration only within the context of replication, to preserve the original data); a migration using transforms on incoming / outgoing data will consist of changes with no record of having been made, potentially leading to all kinds of trouble should the two worlds of document ever meet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants