%% Set One Node Property
% Set one node property for a single node in a Neo4j® database and access the node.
%
% Create a Neo4j database connection using the URL http://localhost:7474/db/data, user name neo4j, and password matlab.

url = 'http://localhost:7474/db/data';
username = 'neo4j';
password = 'matlab';
neo4jconn = neo4j(url,username,password);

%
% Check the Message property of the Neo4j connection object neo4jconn. The blank Message property indicates a successful connection.

neo4jconn.Message

%
% Retrieve the first node in the table of node information. This node has the label Person.

nlabel = "Person";
nodeinfo = searchNode(neo4jconn,nlabel);
node = nodeinfo.NodeObject(1);

%
% Set the Title node property for a single node in the database using the Neo4j database connection.

properties.Title = "Analyst";
setNodeProperty(neo4jconn,node,properties)

%
% Display the node information for the updated node.

nodeinfo = searchNode(neo4jconn,nlabel);
node = nodeinfo.NodeObject(1);
node.NodeData

%
% Close the database connection.

close(neo4jconn)

% Copyright 2018 The MathWorks, Inc.