如何使用 RESTHeart 补丁更新单个对象?

How to update single object with RESTHeart patch?

我正在使用 RESTHeart 和 MongoDB。我有多个 JSON 对象,我想通过 REST 调用一次更新一个特定对象。 我正在关注 https://softinstigate.atlassian.net/wiki/spaces/RH/pages/9207882/Reference+sheet , 但我无法更新我的对象。补丁调用没有给我 200 ok 状态。

我可以使用 补丁,但我无法找到更新的特定对象。

Rh.one('db')
  .one('api')
  .patch(counter, {}, {})
  .then(function(response){

});

当我在花括号中尝试某些条件 if-match 时,我收到此错误:

412(前提条件失败) LIKE

Rh.one('db')
  .one('api')
  .patch(counter, {}, {"If-Match": index.name})
  .then(function(response){

});

我想用补丁更新特定对象。

要更新文档,URI 需要是 /db/coll/<docid>

您缺少请求中的文档 ID URL。