Main Content

close

Close Neo4j database connection

Description

example

close(neo4jconn) closes the Neo4j® database connection.

Examples

collapse all

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)
neo4jconn = 
  Neo4jConnect with properties:

         URL: 'http://localhost:7474/db/data/'
    UserName: 'neo4j'
     Message: []

neo4j returns a Neo4jConnect object with these properties:

  • URL — The Neo4j database web location

  • UserName — The user name used to connect to the database

  • Message — Any database connection error messages

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

neo4jconn.Message
ans =

     []

Retrieve all node labels using the Neo4j database connection neo4jconn. The cell array nlabels contains a character vector for the one node label in the Neo4j database.

nlabels = nodeLabels(neo4jconn)
nlabels = 1×1 cell array
    {'Person'}

Close the database connection.

close(neo4jconn)

Input Arguments

collapse all

Neo4j database connection, specified as a Neo4jConnect object created with the function neo4j.

Version History

Introduced in R2019a