0
尝试了差不多2个小时后,我张贴了这个问题无法在MongoDB中的记录进行更新
$.ajax({
type: "POST" ,
url: "http://127.0.0.1:28017/test/stocks/?q={symbol:"+symbol+"}",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ "$set" : { 'tbq' : "3" } }),
dataType: "json"
});
内MongoDB的样本
{
"_id" : ObjectId("537148b99aae10a52d6b5dbe"),
"symbol" : "KIYT",
"tbq" : "566"
}
有谁请电话我为什么更新ISN”工作?
我以下链接http://docs.mongolab.com/restapi/#update-documents
感谢您的回答,但仍然无法正常更新。 – Pawan
如果我使用PUT而不是POST,我进入我的mongodb控制台[websvr]不知道如何处理[PUT] – Pawan
道歉我没有意识到你正在尝试在本地安装上执行此操作(我应该有看URL!)mongolabs的REST API允许插入和更新,但是mongod的API不。请参阅http://docs.mongodb.org/manual/core/security-interface/#rest-api – mattdavis90