I am using lowdb as my database. So the database file db.json looks like below.
{
"posts": {
"user1" : {
id: 1,
published: false
},
"user2" : {
id: 2,
published: true
}
},
"comments": {
"article1" : {
id: 1,
postId: 1
},
"article2" : {
id: 2,
postId: 2
}
}
}
What I want to achieve is that on match of certain condition, remove the posts key with values. So my db file should look like below.
{
"comments": {
"article1" : {
id: 1,
postId: 1
},
"article2" : {
id: 2,
postId: 2
}
}
}
Any guide will be of great help.