列表数据
之前我们看到返回的数据是这样的
{
"Moment": {
"content": "1111534034",
"date": "2017-02-08 16:06:11.0",
"id": 12,
"pictureList": [
"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg",
"http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg"
],
"praiseUserIdList": [70793, 93793, 82001],
"userId": 70793
},
"code": 200,
"msg": "success"
}
里面的pictureList
和praiseUserIdList
是数组,这种数据在 Mysql 数据库中是 JSON 数据格式的。
数据库里存储的值是这样的
如果我们想过滤出里面有82001
的数据,我们应该这样请求
{
"[]": {
"Moment": {
"praiseUserIdList<>": 82001,
"@column": "id,date,content,praiseUserIdList"
}
}
}
结果是类似这样的,为了显示方便剔除了一些数据。
{
"[]": [
{
"Moment": {
"date": "2017-02-08 16:06:11.0",
"id": 32,
"praiseUserIdList": [38710, 82002, 82001]
}
},
{
"Moment": {
"content": "This is a Content...-435",
"date": "2017-02-01 19:14:31.0",
"id": 58,
"praiseUserIdList": [38710, 82003, 82001]
}
},
{
"Moment": {
"content": "https://gss2.bdstatic.com/-fo3dSag_xIb.jpg",
"date": "2018-10-27 17:58:02.0",
"id": 1540634282433,
"praiseUserIdList": [82001]
}
}
],
"code": 200,
"msg": "success"
}