0

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

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

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){

});

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

4

1 回答 1

0

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

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

于 2018-01-07T08:00:05.970 回答