1
一個複雜的模型,我有一個像模型數據:節省骨幹
{
"status": 7,
"organizations": [{
"org_address": "\u4e2d\u56fd\u5317\u4eac\u5e02\u671d\u9633\u95e8\u59161001\u53f7",
"job_positions": "\u603b\u7ecf\u7406",
"org_id": 11,
"org_name": "\u6570\u7ef4\u79d1\u6280"
}],
"first_name": null,
"last_name": null,
"create_date": "2013-07-02 23:47:14.239000",
"name": "\u5f20\u5174\u6807",
"extra_emails": [null],
"tags": [{
"oid": 4,
"id": 4,
"name": "friend"
}],
"nick_name": "\u9ec4\u98de\u9e3f",
"gender": "\u7537",
"image": null,
"created_by": "system",
"effective_start_date": "2013-07-02 23:47:14.239000",
"social_medias": [{
"url": "http://weibo.com/12345",
"sm_name": "\u6700\u70ab\u6c11\u65cf\u98ce",
"type": "\u65b0\u6d6a\u5fae\u535a",
"party_sm_id": 1
}],
"date_of_birth": "1980-04-01",
"extra_phones": {
"office_phone": "82323333",
"fax": "82324433"
},
"mobile_phone": "13909609306",
"primary_email": "[email protected]",
"id": "10",
"isUser": false
}
現在我想修改數據和保存模型,假設我的模型被命名爲「cmodel」。當我嘗試保存數據,我已經試過如下:
cmodel.save({
organizations[0].org_address:"road1",
organizations[0].org_name:"name1"
});
然而,這並沒有工作,所以我想知道如何挽救我的編輯的數據。
希望你的幫助,謝謝。
但我有一個問題,它可以寫成orgClone [0] .org_address:「road1」, orgClone [0] .org_name:「name1」使用「:」?或者它應該使用「=」寫入 – user2528222
是的,抱歉, 。它應該是一個「=」運算符。我編輯過它。 – dcarson