`pouchdb-req-http-query` is a utility within the PouchDB ecosystem designed to bridge CouchDB-style request objects with PouchDB's internal HTTP request handling. It allows developers to construct a request object formatted similarly to a CouchDB request and then execute it against a given PouchDB database instance as an HTTP operation. This package is currently at version 4.2.0 and receives maintenance updates for bug fixes and dependency management, indicating an active but mature status. Its key differentiators include its role in facilitating lower-level HTTP interactions with PouchDB, particularly when integrating with systems expecting CouchDB's request structures, and its inclusion in the PouchDB monorepo.
npm install pouchdb-req-http-queryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `pouchdb-req-http-query` to perform CouchDB-style GET and POST requests against a local PouchDB instance, including fetching all documents and inserting a new one.
Review the official PouchDB monorepo migration guides and `express-pouchdb` changelogs for specific adjustments required when upgrading from pre-4.0.0 versions.
Refer to the `express-pouchdb` v2.0.0 release page for detailed breaking changes and migration steps.
Enable CORS on your CouchDB/Cloudant server. Tools like `add-cors-to-couchdb` can simplify this, or configure it manually via `curl` or Futon.
Upgrade to `pouchdb-req-http-query` version 4.0.0 or newer to incorporate the security fix.
Upgrade to `pouchdb-req-http-query` version 4.1.0 or newer. Ensure `opts.auth` is correctly structured with `username` and `password` properties if provided.
Upgrade to `pouchdb-req-http-query` version 4.1.0 or newer. If using older versions, manually ensure event listeners are removed or consider increasing `setMaxListeners` as a temporary workaround, though upgrading is strongly recommended.
Upgrade to `pouchdb-req-http-query` version 4.1.0 or newer. Verify that the `body` property of your CouchDB request object (especially for `POST` or `PUT` methods) is a valid JSON serializable object, as PouchDB documents must be pure JSON.