在Cloudant DB上使用NodeJS更新和删除文档

编程入门 行业动态 更新时间:2024-10-22 10:49:46
本文介绍了在Cloudant DB上使用NodeJS更新和删除文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我能够使用HTTP / REST API成功查询(选择)并将数据插入Cloudant数据库。但是我不知道-如何删除和修改文档。

I was able to successfully query(select) and insert data into Cloudant database using HTTP /REST API. But I am not able to figure out - how to delete and modify documents.

要删除:我在nodejs path中尝试了以下代码:'/ quick_loan_nosql_db_1?951b05d1b6aa100f4b94e5185674ef40 / _rev = 1-88963c755157188​​091f0d30115de18ce' REST API请求的部分,方法为:DELETE。 但是执行该操作时,它会删除整个数据库而不是指定ID。

For Delete: I tried the following code in nodejs path : '/quick_loan_nosql_db_1?951b05d1b6aa100f4b94e5185674ef40/_rev=1-88963c755157188091f0d30115de18ce' part of the REST API Request with METHOD: DELETE. But when I execute it deletes the entire database instead of the ID being specified.

用于更新:有人可以提供一个吗?示例,我尝试使用PUT,但作为响应,我收到了冲突数据错误。 任何输入将不胜感激。

For Update: Can some one provide a sample, I tried with PUT, but in response I got a Conflict data error. Any input would be appreciated.

推荐答案

很好!要回答您的原始问题,只需输入 /和?在错误的地方。回顾一下:

Nice! To answer your original question, you just have the "/" and the "?" in the wrong places. To recap:

/ quick_loan_nosql_db_1?951b05d1b6aa100f4b94e5185674ef40 / _rev = 1-88963c755157188​​091f0d30115de18ce

应该 为:

/ quick_loan_nosql_db_1 / 951b05d1b6aa100f4b94e5185674ef40?_rev = 1-88963c755157188​​091f0d30115de18ce

更多推荐

在Cloudant DB上使用NodeJS更新和删除文档

本文发布于:2023-10-30 04:29:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541768.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:新和   文档   Cloudant   DB   NodeJS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!