Neo4j Update Resource icon

Neo4j Update Resource

根據 resource_id 更新資源資訊。,resourceId: 要更新的資源 ID (UUID),type: 新的資源類型 (可選),name: 新的資源名稱/編號 (可選),capacity: 新的資源容量 (可選),propertiesJson: 要更新或添加的其他屬性 (JSON 格式)。留空則不更新此項。

Neo4j Update Resource

AI-generated

Overview

This node updates resource information in a Neo4j graph database based on a given resource ID. It allows modifying various attributes of a resource such as its type, name, capacity, and additional custom properties provided as JSON. If no update fields are specified, it simply returns the current data for the resource.

Common scenarios where this node is useful include:

  • Maintaining an up-to-date inventory of resources in a system.
  • Modifying metadata or capacity details of existing resources dynamically.
  • Adding or updating custom properties to enrich resource nodes without altering the core schema.

For example, you might use this node to update the capacity of a server resource after a hardware upgrade or add new configuration details stored as JSON properties.

Properties

Name Meaning
Resource ID The unique identifier (UUID) of the resource to update.
Type (Optional) New resource type to set.
Name (Optional) New resource name or code to assign.
Capacity (Optional) New numeric capacity value for the resource.
Properties (JSON) (Optional) Additional properties to update or add, provided as a JSON object string. Leaving empty means no change.

Output

The node outputs an array of JSON objects representing the updated resource(s). Each output item contains a resource field with all properties of the resource node after the update.

If no update parameters are provided, the node returns the current state of the resource without modification.

No binary data output is produced by this node.

Dependencies

  • Requires a Neo4j database connection configured via credentials including host, port, username, password, and optionally database name.
  • Uses the official Neo4j driver library to connect and run Cypher queries.
  • Requires proper permissions in Neo4j to match and update resource nodes.

Troubleshooting

  • Missing or incomplete credentials: The node will throw an error if any required Neo4j connection details are missing. Ensure host, port, username, and password are correctly set.
  • Invalid JSON in Properties field: If the JSON string provided in "Properties (JSON)" is malformed or not an object, the node throws a validation error. Validate JSON syntax before input.
  • Resource not found: If the resource ID does not exist in the database, the returned result will be empty. Verify the resource ID correctness.
  • Connection errors: Failure to connect to Neo4j or open a session results in an error. Check network connectivity and Neo4j server status.
  • No update parameters provided: If no fields to update are given, the node returns the current resource data but logs a warning. This is expected behavior.

Links and References

Discussion