开发者

Remove a document field before saving in CouchDB?

开发者 https://www.devze.com 2023-03-19 07:34 出处:网络
I\'m POSTing a documents to couchdb and I want to remove doc.phone field if that is null before I save.

I'm POSTing a documents to couchdb and I want to remove doc.phone field if that is null before I save.

Is that possible without using _update 开发者_如何学运维handler since I want the request to look like: POST /db


Unfortunately, validation functions do not allow you to mutate the document. (it can only accept or reject a write)

However, if you are concerned with the url, perhaps you could use an update handler in conjunction with URL Rewrites.

0

精彩评论

暂无评论...
验证码 换一张
取 消