如何将新值对附加到 lawnchair 中现有的 json 对象
我正在查看 Lawnchair 网站 上的文档,我试图弄清楚如何将新的值对插入到现有数据中。
以下是 Lawnchair 网站上的示例。
var people = new Lawnchair('people');
var me = {name:'brian'};
people.save(me);
现在,如果我想添加“brian”年龄。
我有点期望有类似 people.append("{key:mykey,age:30}")
但看起来没有这样的方法?
还有其他方法可以做到这一点吗?
I was looking documentation at Lawnchair website and I am trying to figure out how do I insert new value pair to existing data.
Following sample in Lawnchair website.
var people = new Lawnchair('people');
var me = {name:'brian'};
people.save(me);
Now if I want to add "brian" age.
I kind of expected having something like people.append("{key:mykey, age:30}")
but looks like there is no such a method?
Is there any any other way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 LawnChair 不太熟悉,但就我能理解的程度而言,我建议如下所示:
age
字段添加到保存的对象中请告诉我这是否有帮助。 :-)
I am not much familiar with LawnChair, but to the extent I can understand it, I would suggest something like the following:
age
field to the saved objectDo tell me if that helps. :-)