Usage

cypher(query, parameterMap)
cypher(query)

Description
Executes the given Cypher query and returns the results. Structr will automatically convert all query results into the corresponding Structr objects, i.e. Neo4j nodes will be instantiated to Structr node entities, Neo4j relationships will be instantiated to Structr relationship entities, and maps will converted into Structr maps that can be accessed using the dot notation (map.entry.subentry).

Note
The cypher() function always returns a collection of objects, even if LIMIT 1 is specified!

Example

${cypher('MATCH (n:User) RETURN n')}

results in

[7379af469cd645aebe1a3f8d52b105bd, a05c044697d648aefe3ae4589af305bd, 505d0d469cd645aebe1a3f8d52b105bd]

Example using Parameters

${{
    var query = "MATCH (user:User) WHERE user.name = { userName } RETURN user";
    var users = Structr.cypher(query, {userName: 'admin'});
}}

Graph-Browser

About this article
Last change 2018-05-04
Topics FrontendFunctionsStructr 2.0