列表数据

之前我们看到返回的数据是这样的

  1. {
  2. "Moment": {
  3. "content": "1111534034",
  4. "date": "2017-02-08 16:06:11.0",
  5. "id": 12,
  6. "pictureList": [
  7. "http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg",
  8. "http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg"
  9. ],
  10. "praiseUserIdList": [70793, 93793, 82001],
  11. "userId": 70793
  12. },
  13. "code": 200,
  14. "msg": "success"
  15. }

里面的pictureListpraiseUserIdList是数组,这种数据在 Mysql 数据库中是 JSON 数据格式的。

1542357146401

数据库里存储的值是这样的

1542357265371

如果我们想过滤出里面有82001的数据,我们应该这样请求

  1. {
  2. "[]": {
  3. "Moment": {
  4. "praiseUserIdList<>": 82001,
  5. "@column": "id,date,content,praiseUserIdList"
  6. }
  7. }
  8. }

结果是类似这样的,为了显示方便剔除了一些数据。

  1. {
  2. "[]": [
  3. {
  4. "Moment": {
  5. "date": "2017-02-08 16:06:11.0",
  6. "id": 32,
  7. "praiseUserIdList": [38710, 82002, 82001]
  8. }
  9. },
  10. {
  11. "Moment": {
  12. "content": "This is a Content...-435",
  13. "date": "2017-02-01 19:14:31.0",
  14. "id": 58,
  15. "praiseUserIdList": [38710, 82003, 82001]
  16. }
  17. },
  18. {
  19. "Moment": {
  20. "content": "https://gss2.bdstatic.com/-fo3dSag_xIb.jpg",
  21. "date": "2018-10-27 17:58:02.0",
  22. "id": 1540634282433,
  23. "praiseUserIdList": [82001]
  24. }
  25. }
  26. ],
  27. "code": 200,
  28. "msg": "success"
  29. }