我试图达到使用它时路由器给你的参数反应
所以我想改变我的路径
var environments=[
{
"name": "test",
"resourceLimits": {
"cpu": {
"min": 0.1, "max": 10
},
"target": {
"targetName": "del",
"env": "dev",
"region": "us-east-1"
}
}
}, {
"name": "test2",
"resourceLimits": {
"cpu": {
"min": 0.1,
"max": 10
},
"target": {
"targetName": "bob",
"env": "dev",
"region": "us-east-1"
}
}
}]
var res = _.find(environments, ['resourceLimits.target.targetName', 'bob']);
console.log(res.name);// "test2"
但实际上,它永远不会有效,它会不断出现错误或找不到