|
已测更新可用(只是更新指定ID
- var model = api.require("model");
- model.config({
- appId: "A6961900616810",
- appKey: "6DCD994B-F0DA-3693-5457-B774B973EDE6"
- });
- //在user里面创建一个关联指定的列 我这里的列为txt关联title表 title表内有name和content两个列
- var relation = api.require("relation");
- relation.insert({
- class: "user",
- id: "546daee661e6304a53c2c23c", //这个为user的ID
- column: "txt", //user里面的txt列关联了title表
- value: {
- id: "546daee661e6304a53c2c12b", //title表内要更新的id
- name: "这里是名称" //更新的内容 把列为name的更新为“这里是名称”
- content: "这里是内容" //更新的内容 把列为content的更新为"这里是内容"
- }
- }, function(ret, err){
- alert(JSON.stringify(ret)); //打印成功返回值
- /*alert(JSON.stringify(err));*/ //打印失败返回值 这里可以不需要
- });
复制代码 的内容) |
|