|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > JSON - Parser > Parser-Operations > PSJ. - JSON Operations |
SPR Script Language
Object Operations
Commands for manipulating JSON objects within the SPR Script Language.
Intention
The Object Operations chapter groups commands in the PSJ. library that are specifically designed to manipulate JSON objects. These commands enable users to add or remove keys, retrieve object keys, merge objects, and manage object nodes within JSON documents. This section is intended for users who need to work with key-value pair collections in their JSON structures.
For example, removing a key from an object or merging two objects can be accomplished using these commands, facilitating the modification of object-based data in a JSON document.
Illustration
📝 Remove a Key: PSJ.DelKey|docHandle|objHandle|keyName removes the specified key from the object.
📝 Get Object Keys: PSJ.GetKeys|docHandle|objHandle|$$KEYS retrieves the keys of the object and stores them in $$KEYS.
Commands
• PSJ.AddChild - Adds a child node to a parent object.
• PSJ.DelKey - Removes a specified key from a JSON object.
• PSJ.GetKeys - Retrieves all keys from a JSON object as a string.
• PSJ.GetObj - Retrieves the node ID of an object by path.
• PSJ.MergeObj - Merges two JSON objects into a single object.
Remarks
- All object operations require a valid document handle and object node identifier.
- Commands like PSJ.DelKey and PSJ.MergeObj allow for dynamic modification of object structures.
See also: