@@ -358,7 +358,7 @@ DELETE: <br > 删除数据 | base_url/delete/ | {<br > TableName:{<
358358 包含选项范围 | "key<\> ": Object => "key<\> ":[ Object] ,key对应值的类型必须为JSONArray,Object类型不能为JSON | [ "contactIdList<\> ":38710] ( http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"contactIdList<\> ":38710}}} ) ,对应SQL是` json_contains(contactIdList,38710) ` ,查询contactIdList包含38710的一个User数组
359359 远程调用函数 | "key()":"函数表达式",函数表达式为 function(key0,key1...),会调用后端对应的函数 function(JSONObject request, String key0, String key1...) | [ "isPraised()":"isContain(praiseUserIdList,userId)"] ( http://apijson.cn:8080/get/{"Moment":{"id":301,"isPraised()":"isContain(praiseUserIdList,userId)"}} ) ,会调用 boolean isContain(JSONObject request, String array, String value) 函数,然后变为 "isPraised": true 这种(假设点赞用户id列表包含了userId,即这个User点了赞)
360360 引用赋值 | "key@":"引用路径",引用路径为用/分隔的字符串。以/开头的是缺省引用路径,从声明key所处容器的父容器路径开始;其它是完整引用路径,从最外层开始。<br /> 被引用的refKey必须在声明key的上面。如果对refKey的容器指定了返回字段,则被引用的refKey必须写在@column 对应的值内,例如 "@column ":"refKey,key1,..." | [ "Moment":{<br />   ;  ; "userId":38710<br />},<br />"User":{<br />   ;  ; "id@":"/Moment/userId"<br />}] ( http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id@":"%252FMoment%252FuserId"}} ) <br /> User内的id引用了与User同级的Moment内的userId,<br />即User.id = Moment.userId,请求完成后<br > "id@":"/Moment/userId" 会变成 "id":38710
361- 子查询 | "key@":{ "range": "ALL", "from":"Table", "Table":{} }, 其中 range 可为 ALL,ANY | [ "id@":{<br />   ;  ; "from":"Comment",<br />   ;  ; "Comment":{<br />   ;  ;   ;  ; "@column ":"min(userId)" <br />   ;  ; }<br />}] ( http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}} ) <br /> WHERE id=(SELECT min(userId) FROM Comment)
361+ 子查询 | "key@":{< br /> & nbsp ;& nbsp ; "range": "ALL", < br /> & nbsp ;& nbsp ; "from":"Table",< br /> & nbsp ;& nbsp ; "Table":{ ... }< br />}< br /> 其中 range 可为 ALL,ANY。< br />from 为目标表 Table 的名称。< br /> 这个对象可使用数组对象 key [ ] :{} 的 count 和 join 等功能。 | [ "id@":{<br />   ;  ; "from":"Comment",<br />   ;  ; "Comment":{<br />   ;  ;   ;  ; "@column ":"min(userId)" <br />   ;  ; }<br />}] ( http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}} ) <br /> WHERE id=(SELECT min(userId) FROM Comment)
362362 模糊搜索 | "key$":"SQL搜索表达式" => "key$":[ "SQL搜索表达式"] ,任意SQL搜索表达式字符串,如 %key%(包含key), key%(以key开始), %k%e%y%(包含字母k,e,y) 等,%表示任意字符 | [ "name$":"%m%"] ( http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name$":"%2525m%2525"}}} ) ,对应SQL是` name LIKE '%m%' ` ,查询name包含"m"的一个User数组
363363 正则匹配 | "key~ ":"正则表达式" => "key~ ":[ "正则表达式"] ,任意正则表达式字符串,如 ^[ 0-9] +$ ,* ~ 忽略大小写,可用于高级搜索 | [ "name~ ":"^[ 0-9] +$"] ( http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name~":"^[0-9]%252B$"}}} ) ,对应SQL是` name REGEXP '^[0-9]+$' ` ,查询name中字符全为数字的一个User数组
364364 连续范围 | "key%":"start,end" => "key%":[ "start,end"] ,其中 start 和 end 都只能为 Boolean, Number, String 中的一种,如 "2017-01-01,2019-01-01" ,[ "1,90000", "82001,100000"] ,可用于连续范围内的筛选 | [ "date%":"2017-10-01,2018-10-01"] ( http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"date%2525":"2017-10-01,2018-10-01"}}} ) ,对应SQL是` date BETWEEN '2017-10-01' AND '2018-10-01' ` ,查询在2017-10-01和2018-10-01期间注册的用户的一个User数组
0 commit comments