【问题标题】:Strongloop: updateAttributes method id parameter is undefinedStrongloop:updateAttributes 方法 id 参数未定义
【发布时间】:2015-04-07 19:26:21
【问题描述】:

我正在为 strongloop 实现一个连接器。

我尝试通过调用 updateAttributes PUT /api/entity/:id

我的连接器的 updateAttributes 方法被命中,但 id 参数未定义。

myConnector.prototype.updateAttributes = function(model, id, body, callback) {

其他方法如 all、create、delete 工作。

怎么了?

环回版本:2.14.0 节点版本:0.10.36

【问题讨论】:

    标签: node.js strongloop


    【解决方案1】:

    我假设 id 按 /api/model/:id 传递。 我有特殊的 ID 名称:_id。我的 model.json 没有这个定义。

    "_id": {
        "type": "string",
        "id": true
    }
    

    【讨论】:

      猜你喜欢
      • 2018-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-20
      • 1970-01-01
      • 2022-12-06
      • 2021-11-17
      • 2019-01-14
      相关资源
      最近更新 更多