Mutable JSON DOMs

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:56 PM on 8/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

27 Terms

1
New cards

JsonNode

An abstract base class in System.Text.Json.Nodes that represents a node in the mutable JSON document object model. Domain: C# → .NET → System.Text.Json.Nodes → Mutable JSON DOM

2
New cards

Mutable JSON DOM

A JSON object model whose nodes can be created, modified, replaced, added, and removed after the JSON structure has been constructed or parsed.

3
New cards

JsonNode.Parse(json)

Parses JSON text and returns a JsonNode representing the root of the resulting mutable JSON structure.

4
New cards

JsonObject

A JsonNode-derived class that represents a mutable JSON object containing property-name and JSON-node pairs.

5
New cards

JsonArray

A JsonNode-derived class that represents a mutable ordered collection of JSON nodes.

6
New cards

JsonValue

A JsonNode-derived class that represents a primitive JSON value such as a string, number, or Boolean value.

7
New cards

new JsonObject()

Creates an empty mutable JSON object.

8
New cards

new JsonArray()

Creates an empty mutable JSON array.

9
New cards

node[propertyName]

Gets or sets a child node associated with a property name when working with a JSON object.

10
New cards

node[index]

Gets or sets the child node at a zero-based position when working with a JSON array.

11
New cards

jsonObject.Add(propertyName, value)

Adds a new named property and its value to a JsonObject.

12
New cards

jsonObject.Remove(propertyName)

Removes the property with the specified name from a JsonObject and reports whether removal occurred.

13
New cards

jsonObject.ContainsKey(propertyName)

Determines whether a JsonObject contains a property with the specified name.

14
New cards

jsonObject.TryGetPropertyValue(propertyName, out value)

Attempts to retrieve the JsonNode associated with a named property from a JsonObject.

15
New cards

jsonArray.Add(value)

Adds a value to the end of a JsonArray.

16
New cards

jsonArray.Insert(index, value)

Inserts a value into a JsonArray at the specified zero-based position.

17
New cards

jsonArray.RemoveAt(index)

Removes the JsonArray element at the specified zero-based position.

18
New cards

jsonArray.Count

Gets the number of elements currently contained in a JsonArray.

19
New cards

node.GetValue()

Gets the value represented by a compatible JsonNode as the specified .NET type.

20
New cards

node.AsObject()

Returns the current JsonNode as a JsonObject when the node represents a JSON object.

21
New cards

node.AsArray()

Returns the current JsonNode as a JsonArray when the node represents a JSON array.

22
New cards

node.Parent

Gets the parent JsonNode containing the current node, or null when the node has no parent.

23
New cards

node.Root

Gets the topmost JsonNode in the tree containing the current node.

24
New cards

node.DeepClone()

Creates a recursive copy of the JsonNode and all of its descendant nodes.

25
New cards

node.ToJsonString()

Converts the JsonNode and its descendants into JSON text.

26
New cards

JsonNode Replacement

A child value in the mutable DOM can be replaced by assigning a new value or node through the appropriate property-name or array-index accessor.

27
New cards

JsonNode vs JsonDocument

JsonNode provides a mutable JSON DOM designed for creating and modifying JSON, whereas JsonDocument provides a read-only DOM optimized for examining JSON without modifying its structure.