diff --git a/README.md b/README.md index a39cfac90..efac68722 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,7 @@ DELETE:删除数据,非明文 | base_url/delete/ | {TableName:{"id":id}, "ta "name:alias",name映射为alias,用alias替代name。可用于 column,Table,SQL函数 等。只用于GET类方法、HEAD类方法的请求 | 新建别名 | ["@column":"toId:parentId"](http://139.196.140.118:8080/get/{"Comment":{"@column":"id,toId:parentId","id":51}}),将查询的字段toId变为parentId返回 "key+":key指定类型的Object,且类型为Number,String,JSONArray中的一种。如 1,"apijson",["url0","url1"] 等。只用于PUT请求 | 增加 或 扩展 | "praiseUserIdList+":[1],添加一个点赞用户id,即该用户点了赞 "key-":key指定类型的Object,同"key+" | 减少 或 去除 | "balance-":100.00,余额减少100.00,即花费了100元 - &, \|, ! 逻辑运算符。
① & 可用于"key&{}":"条件"等
② \| 可用于"key\|{}":"条件", "key\|{}":[]等,一般可省略
③ ! 可单独使用,如"key!":Object,也可像&,\|一样配合其他功能符使用 | 逻辑运算 | ① ["id&{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id&{}":">80000,<=90000"}}),即id满足id>80000 & id<=90000
② ["id\|{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id\|{}":">80000,<=90000"}}),同"id{}":">80000,<=90000",即id满足id>80000 \| id<=90000
③ ["id!{}":[82001,38710]](http://139.196.140.118:8080/head/{"User":{"id!{}":[82001,38710]}}),即id满足 ! (id=82001 \| id=38710),可过滤黑名单的消息 + &, \|, ! 逻辑运算符。
① & 可用于"key&{}":"条件"等
② \| 可用于"key\|{}":"条件", "key\|{}":[]等,一般可省略
③ ! 可单独使用,如"key!":Object,也可像&,\|一样配合其他功能符使用 | 逻辑运算 | ① ["id&{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id&{}":">80000,<=90000"}}),即id满足id>80000 & id<=90000
② ["id\|{}":">90000,<=80000"](http://139.196.140.118:8080/head/{"User":{"id\|{}":">90000,<=80000"}}),同"id{}":">90000,<=80000",即id满足id>90000 \| id<=80000
③ ["id!{}":[82001,38710]](http://139.196.140.118:8080/head/{"User":{"id!{}":[82001,38710]}}),即id满足 ! (id=82001 \| id=38710),可过滤黑名单的消息 "@key":key指定类型的Object,@key为JSONObject中的关键词
① "@column":"key0,key1...", 指定返回字段
② "@order":"key0,key1+,key2-...",指定排序方式
③ "@group":"key0,key1,key2...",指定分组方式。如果@column里声明了Table主键(一般是id),则该主键也必须在@group中声明;其它情况下必须满足至少一个条件:1.分组的key在@column里声明;2.Table主键在@group中声明
④ "@having":"function0(...)?valu0,function1(...)?valu1,function2(...)?value2...",指定分组函数条件,必须和@group一起用,函数一般在@column里声明 | 关键词,可自定义 | ① 只查询id,sex,name这几列并且请求结果也按照这个顺序:
["@column":"id,sex,name"](http://139.196.140.118:8080/get/{"User":{"@column":"id,sex,name","id":38710}})
② 查询按 name降序、id默认顺序 排序的User数组:
["@order":"name-,id"](http://139.196.140.118:8080/get/{"[]":{"count":10,"User":%7B"@column":"name,id","@order":"name-,id"}}})
③ 查询按userId分组的Moment数组:
["@group"="userId,id"](http://139.196.140.118:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})
④ 查询 按userId分组、id最大值>=100 的Moment数组:
["@column":"userId,max(id)",
"@group":"userId",
"@having":"max(id)>=100"](http://139.196.140.118:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id)","@group":"userId","@having":"max(id)>=100"}}})
还可以指定函数返回名:
["@column":"userId,max(id):maxId",
"@group":"userId",
"@having":"maxId>=100"](http://139.196.140.118:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id):maxId","@group":"userId","@having":"maxId>=100"}}})
⑤ 从pictureList获取第0张图片:
[{
  "@position":0, //这里@position为自定义关键词
  "firstPicture()":"get(Collection:pictureList,int:@position)"
}](http://139.196.140.118:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"get(Collection:pictureList,int:@position)"}})
... ##

5.使用方法