A Rappopo DAB implementation for PouchDB.
Simply invoke this command in your project folder:
$ npm install --save @rappopo/dab-pouch
And within your script:
const DabPouch =const dab =path: '/home/me/pouchdb'// prepare collectionsdab...// lets dab!dab
path: the path where all PouchDB folder will be saved and reside. If it not provided, it'll defaults to /tmp
retainOnRemove: array of columns to retain when a document is deleted. Default: .
When PouchDB delete a document, it actually PUTs a document with content like this:
"_id": "<doc_id>""_rev": "<rev_id>""_deleted": true
But sometimes you want to also have some columns to be put on that deleted document. The
retainOnRemove simply left those columns intact, e.g:
"_id": "<doc_id>""_rev": "<rev_id>""_deleted": true"type": "<mytype>"