How to store JSON data to usermeta table

In an earlier step we took the JSON data from the API, decoded it to an array and simplified the data then encoded it back to JSON. This is the JSON:

{
"July 08, 2024": 69600,
"June 23, 2024": 70600,
"June 20, 2024": 68500
}

Storing this in the usermeta table for a given user is very simple. We are assuming the user_id is 771 for this example.

update_user_meta($currentUser, 'readings', $scaleData);

This will store the JSON in the row the usermeta table that corresponds to user_id 771 and meta_key “readings”. If there is no such row one will be created.