Delete a json key-vaue in nunjucks variable

470 views Asked by At

I am stuck at a point where I want to delete a key-value pair from json object in nunjucks template variable.

I have an object: var json = {"id": "123", "obj": {"id": "456", "name": "testing"}, "name":"test", "template": "{% set object = json.obj %}{{object}}"}

In this I am getting entire object without modification. So how can I achieve this in nunjucks template variable?

1

There are 1 answers

1
michelem On

I think you can set it as null or undefined:

{% set obj.name = null %}