nlohmann::basic_json::update

updates a JSON object from another object, overwriting existing keys

Synopsis

Declared in <nlohmann/json.hpp>

void
update(
    const_iterator first,
    const_iterator last,
    bool merge_objects = false);

Parameters

NameDescription
firstiterator to the first element of the range of key/value pairs to update from
lastiterator past the last element of the range of key/value pairs to update from
merge_objectswhether to merge nested objects recursively instead of overwriting them