在 couchdb 中使用curl删除字段

发布于 2024-08-30 17:05:12 字数 191 浏览 3 评论 0原文

我搜索但没有找到,我可以使用curl删除couchdb文档的字段吗?

我最多能做的就是删除一个文档:

 curl -X DELETE http://localhost:5984/users/jack?rev=1-cee2abbbe4afefa9b3b5db10260c0c94

谢谢。

I searched and didn't found, can I delete a field of a couchdb's document using curl ?

The most I can do is delete a document:

 curl -X DELETE http://localhost:5984/users/jack?rev=1-cee2abbbe4afefa9b3b5db10260c0c94

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

池木 2024-09-06 17:05:12

如果要删除任何字段,则需要通过 PUT 方法编辑文档,在该方法中发送文档、id 和 rev 的所有字段。包括,但没有删除字段。
Http 方法 DELETE 仅用于删除完整文档,其中没有字段:)

If you want delete any field, you need edit document via PUT method, where you send all fields of document, id and rev. included, but without field for delete.
Http method DELETE is only for delete complete document, no field in that:)

2024-09-06 17:05:12

我相信您应该执行包含修改后的文档以及您正在修改的版本的 _rev 的 PUT 请求。

I believe you're supposed to execute a PUT request containing the modified document, and the _rev of the version you're modifying.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文