Add node labels to multiple nodes in a Neo4j® database, remove the new node labels, and access the updated node information using an output argument.
Create a Neo4j database connection using the URL http://localhost:7474/db/data
, user name neo4j
, and password matlab
.
Check the Message
property of the Neo4j connection object neo4jconn
. The blank Message
property indicates a successful connection.
Find nodes with the label Person
.
Add multiple node labels to the nodes in the database using the Neo4j database connection.
Display the node information for the updated nodes. Each node has three node labels (Person
, Analyst
, and Scientist
).
ans = 7×1 cell array
{3×1 cell}
{3×1 cell}
{3×1 cell}
{3×1 cell}
{3×1 cell}
{3×1 cell}
{3×1 cell}
Remove the labels Analyst
and Scientist
from the updated nodes and display updated node information. Each node now has only the label Person
. The nodeinfo
output argument is a Neo4jNode
object.
ans = 7×1 cell array
{'Person'}
{'Person'}
{'Person'}
{'Person'}
{'Person'}
{'Person'}
{'Person'}
Close the database connection.