Skip to content

Update/Add object fields #648

Description

@definename

Hi,
Is it possible to modify array address without rewriting existing fields, for example I have this json:
nlohmann::json j = { { "name", "oleg" }, { "address", { "city", "kharkiv" } } };

And I need to add several fields to array address:
j["address"] = nlohmann::json { { "country", "ukraine"}, { "street", "svobody"} };
This variant rewrite array address and I lose data which were in it before I added new one.

So my question is: Is it possible to add data to existing array without loss existing one. Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions