1
在休耕模式中,我想制作一个Web服务来发送数据并将其保存到数据库中。如何使一个web服务通过环回在mongodb中通过url发送数据?
localhost:3000/api/shops/shopname=cafe del mar&tel=123456&latlng=50.35;56.44&personId=1729451234
商店模型
{
"shopname": "string",
"tel": "string",
"latlng": "string",
"address": "string",
"id": "string",
"personId": "string"
}
tnx,但它显示了下面的错误:。 错误 404未知“shop”id“create-new-shop”。 status:404 code:MODEL_NOT_FOUND 错误:未知“shop”id“create-new-shop”。 – RSA
更改您的“id”属性的名称。 Loopback具有名为“id”的默认主键属性。也许他们互相干扰。请让我知道如果问题解决了。 – tashakori
我认为它与'var shop = new app.models.Shop(instance)'有关,因为它在explorer中显示:'“message”:“app is not defined”, “stack”:“ReferenceError:app is not定义\ n'。在server.js应用程序中已定义 – RSA