This commit is contained in:
nlohmann committed 2026-11-09 18:59:22 +00:00
1 parent cf8df97ba7
commit eeea067a72
566 files changed
+15370 -2688

No files matched your search

+2 -2
View File
@@ -113,7 +113,7 @@ a.erase(1); // [1,3,4] (erase by index)
## Editing a document
The operations above work on a `basic_json` value. A JSON text that was parsed into a [document](https://json.nlohmann.me/features/json_view/#editing-a-document) can also be changed in place, without building a `basic_json` tree for the parts that are not touched: [`set`](https://json.nlohmann.me/api/basic_json_document/set/index.md) replaces a value, adds or replaces an object member, or replaces an array element (also through a JSON pointer), [`push_back`](https://json.nlohmann.me/api/basic_json_document/push_back/index.md) appends to an array, [`insert`](https://json.nlohmann.me/api/basic_json_document/insert/index.md) inserts into an array (unlike `basic_json::insert`, it has no object overload; members are added with `set`), and [`erase`](https://json.nlohmann.me/api/basic_json_document/erase/index.md) removes a member or an element. These functions are available on the editable document types, such as [`json_editable_document`](https://json.nlohmann.me/api/json_editable_document/index.md).
The operations above work on a `basic_json` value. A JSON text that was parsed into a [document](https://json.nlohmann.me/features/json_view/editing/index.md) can also be changed in place, without building a `basic_json` tree for the parts that are not touched: [`set`](https://json.nlohmann.me/api/basic_json_document/set/index.md) replaces a value, adds or replaces an object member, or replaces an array element (also through a JSON pointer), [`push_back`](https://json.nlohmann.me/api/basic_json_document/push_back/index.md) appends to an array, [`insert`](https://json.nlohmann.me/api/basic_json_document/insert/index.md) inserts into an array (unlike `basic_json::insert`, it has no object overload; members are added with `set`), and [`erase`](https://json.nlohmann.me/api/basic_json_document/erase/index.md) removes a member or an element. These functions are available on the editable document types, such as [`json_editable_document`](https://json.nlohmann.me/api/json_editable_document/index.md).
## See also
@@ -123,7 +123,7 @@ The operations above work on a `basic_json` value. A JSON text that was parsed i
- [`merge_patch`](https://json.nlohmann.me/api/basic_json/merge_patch/index.md) - apply an RFC 7396 merge patch
- [`erase`](https://json.nlohmann.me/api/basic_json/erase/index.md) - / [`clear`](https://json.nlohmann.me/api/basic_json/clear/index.md) - remove elements
- [JSON Patch and Diff](https://json.nlohmann.me/features/json_patch/index.md) - and [JSON Merge Patch](https://json.nlohmann.me/features/merge_patch/index.md) - structured modifications
- [Editing a document](https://json.nlohmann.me/features/json_view/#editing-a-document) - change a parsed document in place
- [Editing a document](https://json.nlohmann.me/features/json_view/editing/index.md) - change a parsed document in place
- [`insert`](https://json.nlohmann.me/api/basic_json/insert/index.md) - insert elements at an iterator position or merge a range
- [`operator+=`](https://json.nlohmann.me/api/basic_json/operator%2B%3D/index.md) - shorthand for `push_back`
- [Element Access](https://json.nlohmann.me/features/element_access/index.md) - read elements