0 votes
16 views
in General by
How to delete an ArduinoJson nested key?

I'm surely missing something here.

Wondering is there a way to delete a nested key somewhere?
for example, if I want to remove the "J" from this JSON obj?
{"H":{"K":"","J":"","M":0}}

Can .remove() do this?

not sure as it brings up this error

error: 'class ArduinoJson::Internals::JsonObjectSubscript<const char*>' has no member named 'remove'

thanks!

1 Answer

0 votes
by

If you are using the v5 of ArduinoJson

doc["H"].remove("J");

If you are using the v6 of ArduinoJson

JsonObject& hobj = root["H"];
hobj.remove("J");

Related questions

0 votes
1 answer 16 views
0 votes
0 answers 27 views
0 votes
1 answer 88 views
0 votes
2 answers 4.5k views
asked Jul 17, 2018 in General by anonymous
+1 vote
1 answer 8.4k views
...