Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

JsonPath支持Map条件筛选对象 #1839

@zzy8811

Description

@zzy8811

jsonpath直接支持Map条件筛选

如有以下对象,希望筛选出score>0.7的的对象列表,用jsonPath编写时发现不能支持,目前只支持List模式,是否可直接支持Map?

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONPath;
def jsonStr ="""
{
	"risk_sexy_trade_stream_plus": {
		"score": 0
	},
	"chemical_medicine_stream_plus": {
		"score": 0
	},
	"gambling_trade_stream_plus": {
		"score": 0
	},
	"politics_stream_plus": {
		"score": 0.89513221556685012
	},
	"risk_tool_gun_stream_plus": {
		"score": 0
	},
	"sex_model_stream_plus": {
		"score": 0.7237896928683851
	},
	"risk_tool_cheat_stream_plus": {
		"score": 0
	},
	"risk_tool_certif_stream_plus": {
		"score": 0
	},
	"gamble_model_stream_plus": {
		"score": 0.3453003960431523
	},
	"risk_tool_vpn_stream_plus": {
		"score": 0
	},
	"vpndetect_stream_plus": {
		"score": 0.3467174233072834
	}
}
""";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions