简体   繁体   English

RESTHeart PATCH未更新文档

[英]RESTHeart PATCH not updating the document

I am trying to update a key in the MongoDB document using RESTHear api but the value is not getting updated, however, I am getting 200 OK. 我正在尝试使用RESTHear api更新MongoDB文档中的密钥,但是该值没有得到更新,但是,我得到了200 OK。

I tried PATCH and PUT both. 我尝试了PATCH和PUT两者。 Below are the URIs I tried. 以下是我尝试过的URI。

http PUT "http://localhost:8080/presence/active_watchers?filter={'presentity_uri':'sip:service-1@opensipstest.org'}" event_id=12

http PATCH "http://localhost:8080/presence/active_watchers?filter={'presentity_uri':'sip:service-1@opensipstest.org'}" event_id=12

Both the time I got 200 OK response but the value didn't update. 两次我都得到200 OK响应,但是值没有更新。

Am I doing something wrong. 难道我做错了什么。 I couldn't find any example for this. 我找不到任何示例。

I am using Restheart v 2.0.0 Beta. 我正在使用Restheart v 2.0.0 Beta。

To bulk update documents matching a filter expression do http PATCH "http://localhost:8080/presence/active_watchers/*?filter={'presentity_uri':'sip:service-1@opensipstest.org'}" event_id=12 要批量更新与过滤器表达式匹配的文档,请执行http PATCH "http://localhost:8080/presence/active_watchers/*?filter={'presentity_uri':'sip:service-1@opensipstest.org'}" event_id=12

If you PUT/PATCH the URI /presence/active_watchers you actually update the collection properties (in RESTHeart dbs and collections have their own properties). 如果您对URI /presence/active_watchers PUT / PATCH,则实际上会更新集合属性(在RESTHeart数据库中,集合具有自己的属性)。

To update documents, you need to provide a document URI /db/coll/docid and for bulk updates you can use the wildcard /db/coll/*?filter=[filter expression] 要更新文档,您需要提供文档URI /db/coll/docid ,对于批量更新,可以使用通配符/db/coll/*?filter=[filter expression]

See Resource URI in the documentation form more information. 有关更多信息,请参见文档表格中的资源URI

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM