-
I want to thank @janl and @rnewson for answering my question posted at #5493. as a follow up to that question - if I want to reinforce change-logs and creation/update timestamps in my databases, one thing is to implement something, such as adding relevant keys and maintain a change-log in the doc, in the updates handler. However, I can only add these keys if someone posts updated docs via the update handler in the design doc, such as
however, if someone posts a new version of doc via the If I want to reinforce this by using update-handler as the only way to upload/update docs, I will need to redirect PUT request towards /db/doc to the update handler URL. If this is running on my Apache server, I can do this using is there another way to perform this URL redirect? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @fangq. Disclaimer: I'm a mere user. Nothing authoritative here. You could check the documentation of CouchDB A more "lasting" option would be to put this rewrite rule into your reverse proxy setting. A section in CouchDB documentation is dedicated to reverse proxies. |
Beta Was this translation helpful? Give feedback.
-
update handlers exist for clients incapable of performing logic or data manipulation, and that's basically nothing these days. Do your document construction and validation on the client. You can use a validate_doc_update function on couchdb as an inescapable check on what is written to the database. so;
|
Beta Was this translation helpful? Give feedback.
Hi @fangq.
Disclaimer: I'm a mere user. Nothing authoritative here.
You could check the documentation of CouchDB
_rewrite
API. But please note that this feature is deprecated and will be removed in CouchDB 4.A more "lasting" option would be to put this rewrite rule into your reverse proxy setting. A section in CouchDB documentation is dedicated to reverse proxies.