Reputation: 157
I need to remove a child object in FQL. Let me demonstrate with the following example:
{
"1": {
"name": "test"
},
"2": {
"name": "test2"
}
}
And I want this JSON to look like this:
{
"1": {
"name": "test"
}
}
Is there an FQL function that could help me?
Upvotes: 0
Views: 133
Reputation: 4521
For a bare object, you can use the Merge
function to remove object keys by setting their value to null
:
> Merge({"1": { "name": "test" }, "2": { "name": "test2" }}, { "2": null })
{ '1': { name: 'test' } }
Upvotes: 1