🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

pouchdb-couchdb-transform-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pouchdb-couchdb-transform-cli

You have a pouchdb/couchdb with lots of docs. You need to transform some or all of them in a perfomant way that won't blow up the memory on your machine. Write your transformer and use. Note that if this module gives you trouble, you can also try https://

1.0.0
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

pouchdb-couchdb-transform-cli

You have a pouchdb/couchdb with lots of docs. You need to transform some or all of them in a perfomant way that won't blow up the memory on your machine. Write your transformer and use. Note that if this module gives you trouble, you can also try https://github.com/ntsang168/couchtransform which is strictly for use with CouchDB.

Install

npm install -g pouchdb-couchdb-transform-cli

Example transformer usage

This will transform all docs with property of foo so that foo equals true. Save it as a file named transformer-example.js.

module.exports = function(doc) {
  if (doc.foo) return Object.assign({}, doc, {foo: true})
}

Note that if you don't return the doc, it won't be transformed / updated in the database.

Then run that transformer against a database.

pouchdb-couchdb-transform-cli 'http://admin:password@couchdb:5984' test-db ./transformer-example.js

Note that if that was a local PouchDB database using LevelDB your command might look like....

pouchdb-couchdb-transform-cli ./db/ test-db ./transformer-example.js

Limitations

With the current code you can't pass in view keys which would be handy. Want to send a PR? :-)

FAQs

Package last updated on 18 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts