我有这样的对象,我需要用 jmespath 评估哪个“最便宜”
{
"wines": [
{
"name": "b",
"price1": 30,
"price2": 110
},
{
"name": "a",
"price1": 50,
"price2": 1
},
{
"name": "c",
"price1": 40,
"price2": 1130
}
]
}
输出应该是:'a'对象
我在做:
min_by(wines, &price1, &price2).name
min_by(wines, &price1).name
min_by(wines, sum(&price1, &price2)).name
但没有运气