0
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
JSONPath删除带"$..abc"失败,为什么?
@Test
public void testJson() {
JSONObject father = new JSONObject();
JSONObject children = new JSONObject();
children.put("abc", "123");
father.put("name", children);
System.out.println();
System.out.println(father);
System.out.println(JSONPath.remove(father, "$..abc"));
System.out.println(father);
}
输出为:
{"name":{"abc":"123"}}
false
{"name":{"abc":"123"}}
期望输出: {"name":{"abc":"123"}} true {"name":{}}