我能够使用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-88963c755157188091f0d30115de18ce' 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-88963c755157188091f0d30115de18ce
应该 为:
/ quick_loan_nosql_db_1 / 951b05d1b6aa100f4b94e5185674ef40?_rev = 1-88963c755157188091f0d30115de18ce
更多推荐
在Cloudant DB上使用NodeJS更新和删除文档
发布评论