lunes, 24 de julio de 2017

Purge database in couchdb

Resumen:
Primero crea el filtro en la db origen
{
   "_id": "_design/filters",
   "filters": {
       "deletedfilter": "function(doc, req) { return !doc._deleted; };"
   }
}
Luego crea un nuevo doc en la bd _replicator:

{
   "_id": "replicateCleanup",
   "source": "original_database",
   "target": "http://admin:password@localhost:5984/original_database_replica",
   "create_target": true,
   "filter": "filters/deletedfilter",
   "owner": "admin",
   "continuous": true
}

Para más info:
https://eclipsesource.com/blogs/2015/04/20/how-to-finally-delete-documents-in-couchdb/

No hay comentarios:

Publicar un comentario