名称 | method | url | 传参数(JSON) | 解释 |
创建库 | put | http://127.0.0.1:8033/test | 创建库 | |
创建表 | put | http://127.0.0.1:8033/test/coll | 创建表 | |
插入数据 | post | http://127.0.0.1:8033/test/coll | [ { "name": " 王五", "age": "30", "sex": "女" }, { "name": "赵六", "age": "35", "sex": "男" }, { "name": "马七", "age": "40", "sex": "男" }, { "name": "丁一", "age": "50", "sex": "女" }, { "name": "丁二", "age": "30", "sex": "女" }, { "name": "丁三", "age": "20", "sex": "女" }, { "name": "丁四", "age": "18", "sex": "男" } ] |
插入数据 |
查找 | get | http://127.0.0.1:8033/test/coll | 查找所有的 | |
条件查找(性别) | get | http://127.0.0.1:8033/test/coll?filter={‘sex‘:‘女‘} | 查找出所有的女生 | |
排序(根据age) | get | http://127.0.0.1:8033/test/coll?sort_by=age | 根据年龄排序查找 | |
查找 | get | http://127.0.0.1:8033/test/coll?sort_by=age&sort_by=sex | 根据age和sex正序排列,如何是反序/test/coll?sort_by=-age (其他的相同) | |
查找 | get | http://127.0.0.1:8033/test/coll?keys={‘name‘:1 } |
只返回name字段 | |
查找 | get | http://127.0.0.1:8033/test/coll?keys={‘name‘:0 } |
返回除name的其他字段 | |
模糊查找 | get | http://127.0.0.1:8033/test/coll?filter={‘age‘:{‘$regex‘:‘(^((3[1-9])|([2-9]\d)|([1-9]\d{2,}))$)‘}}" | 使用正则表达式,查出age大于30小于40的人(也可以使用中文如filter={‘name‘: {‘$regex‘:‘丁‘}}")也可以双重查询 |
|
分页 | get | http://127.0.0.1:8033/test/coll?count&page=3&pagesize=2 | 查出总条数,和第 20 to 29条的数据,每页显示两条 | |
模糊查找+分页 | get | http://127.0.0.1:8033/test/coll?count&page=1&pagesize=4&filter={‘name‘:{‘$regex‘:‘丁‘}}" | 分页查找+条件模糊查找 | |
参考资料地址: https://softinstigate.atlassian.net/wiki/display/RH01X/Query+Documents |
||||
https://softinstigate.atlassian.net/wiki/pages/viewpage.action?pageId=23461902 | ||||
时间: 2024-10-22 05:25:18