0
votes

I'm implementing a connector for strongloop.

I try to updateAttributes by calling PUT /api/entity/:id

My connector's updateAttributes method is hit but the id parameter is undefined.

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

Other methods like all, create, delete work.

What is wrong?

loopback version: 2.14.0 node version: 0.10.36

1

1 Answers

0
votes

I assumed that the id was passed as is /api/model/:id. I had special Id name: _id. My model.json didn't have this definition.

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