filter the Json according to string in an array in JSONPATH

前端 未结 3 1772
春和景丽
春和景丽 2021-01-15 10:39

I have a situation where I have json String that has a child as Array that contains only Strings. Is there as way I can get the object reference of the arrays that contains

3条回答
  •  庸人自扰
    2021-01-15 11:41

    Did you try to use underscoreJS ? You can get the Indian books like this :

    var data = {"Books:"....};
    
    var indianBooks = _.filter(data.Books.History, function(book) { return _.contains(book.Tags, "Indian"); })
    

提交回复
热议问题