【发布时间】:2018-04-20 06:56:10
【问题描述】:
** 以下是我的 JSON 数据
我想使用 nodejs 过滤并拥有 rulescore > 0 的数据
**
{
"https://www.google.com":{
"sitescore":99,
"rules":[
{
"rulename":"rule1","rulescore":0,"description":"rules1 descript"},
{
"rulename":"rule2","rulescore":1,"description":"rules2 descript"},
{
"rulename":"rule3","rulescore":0,"description":"rules3 descript"}
]
}
}
**
我想使用 nodejs 过滤并拥有 rulescore > 0 的数据
**
【问题讨论】:
-
到目前为止,您尝试过哪些
filters?如果您需要帮助调试,请发布您的代码 -
首先将 JSON 转换为 javascript 对象,稍后你会感谢我的
-
我尝试使用 npm 包下划线,但我不知道该怎么做
-
@VedaVyas 当数组有
filter方法时,你为什么还要费心下划线?见Array.prototype.filter
标签: javascript json node.js