loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Can not findById, deleteById of id injected documents

Open slimdo opened this issue 4 years ago • 0 comments

My get all method return as follow [ { "code": "Server", "name": "Server", "status": "active", "createdAt": "2021-12-13T16:32:46.069Z", "updatedAt": "2021-12-13T16:32:46.069Z", "createdBy": { "appId": "service-management", "userId": "2d9ef30a-a9e5-4ba9-934d-b39cbbf8ebcc", "orgId": "" }, "id": "123543" } ]

Document on mongodb image

I can not get this document by id findById return { "error": { "statusCode": 404, "name": "Error", "message": "Unknown \"ServiceType\" id \"123543\".", "code": "MODEL_NOT_FOUND" } } deleteById return { "count": 0 }

My Model.json for id injection as follow image

Is something wrong with my code? Please give me a solution.

slimdo avatar Dec 13 '21 18:12 slimdo