我有这种状态的数据
{prodName:"parle",prodDesc:"The fresh milk biscuits for children",prodPrice:"30",prodManufacturer:"biscuits"}
我在发布请求时想要这种形式的数据,并且我试图从
获取此值{"prodName":"parle","prodDesc":"The fresh milk biscuits for children","prodPrice":30,"prodManufacturer":"biscuits"}
请任何人都可以帮助无法在mongo db中推送数据
答案 0 :(得分:0)
您需要致电JSON.stringify
以便用双引号括起来
db.state.find({},{_id:0})
.forEach(function(d){
print(JSON.stringify(d));
}
)
输出
> db.state.find({},{_id:0}).forEach(function(d){ print ( JSON.stringify(d))})
{"prodName":"parle","prodDesc":"The fresh milk biscuits for children","prodPrice":"30","prodManufacturer":"biscuits"}
>