使用Redis时, 查询出重复的数据出现$ref

Object data = redisTemplate.opsForHash().get(TRANSACTIONREPORT, account.getMt4UserId());

运行结果是:

[{"account":"2121"},{"$ref":"$[0]"}]

 

如果接口返回上面的数据, 客户端解析数据时会出现问题, 为了避免 $ref出现, 可以使用下面的代码解决:

JSONObject.parseObject(JSON.toJSONString(list, SerializerFeature.DisableCircularReferenceDetect))

 

相关文章:

  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2022-12-23
  • 2021-11-21
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案