0

このデータベースhttp://ashleyw.co.uk/project/food-nutrition-databaseDairy and Egg Productsがあり、グループを別の Json ファイルに抽出したいと考えています。

また、グループ内で一部のデータが 3 倍になっています。例えば:

{
    "id": 1008,
    "description": "Cheese, caraway",
    "tags": [],
    "manufacturer": "",
    "group": "Dairy and Egg Products",
    "portions": [
        {
            "amount": 1,
            "unit": "oz",
            "grams": 28.35
        }
    ],
    "nutrients": [
        {
            "value": 25.18,
            "units": "g",
            "description": "Protein",
            "group": "Composition"
        },
        {
            "value": 29.2,
            "units": "g",
            "description": "Total lipid (fat)",
            "group": "Composition"
        },
        {
            "value": 3.06,
            "units": "g",
            "description": "Carbohydrate, by difference",
            "group": "Composition"
        },
        {
            "value": 25.18,
            "units": "g",
            "description": "Protein",
            "group": "Composition"
        },
        {
            "value": 29.2,
            "units": "g",
            "description": "Total lipid (fat)",
            "group": "Composition"
        },
        {
            "value": 3.06,
            "units": "g",
            "description": "Carbohydrate, by difference",
            "group": "Composition"
        },
        {
            "value": 25.18,
            "units": "g",
            "description": "Protein",
            "group": "Composition"
        },
        {
            "value": 29.2,
            "units": "g",
            "description": "Total lipid (fat)",
            "group": "Composition"
        },
        {
            "value": 3.06,
            "units": "g",
            "description": "Carbohydrate, by difference",
            "group": "Composition"
        }
    ]
}

nutrientsノードのすべての子が 3 倍になります。余分なものをどのように取り除くことができますか?

4

1 に答える 1