Buenas tengo un archivo comments.json que contiene lo sguiente:
{
"comments": [
{
"id": 1,
"post_id": 2,
"name": "Javi",
"email": "j_alonso_78@hotmail.com",
"body": "Esto es un post",
"created_at": "2017-12-29"
},
{
"id": 2,
"post_id": 1,
"name": "Pepe",
"email": "pepe@gmail.com",
"body": "Otro post de pepe",
"created_at": "2017-12-29"
}
]
}
Como puedo añadir a este archivo lo siguiente:
{
"id": 3,
"post_id": 1,
"name": "Juan",
"email": "juan@gmail.com",
"body": "nuevo post",
"created_at": "2017-12-29"
}