Neo4j CQL

 

Cypher Query Language Commands



Neo4j Read CQL Clauses

  1. MATCH
    • This clause is used to search the data with a specified pattern.
    • Syntax: Match (n)
  2. OPTIONAL MATCH
    • This is the same as match
    • The only difference being it can use nulls in case of missing parts of the pattern.
  3. WHERE
    • This clause id is used to add contents to the CQL queries.
  4. START
    • This clause is used to find the starting points through the legacy indexes.
  5. LOAD CSV
    • This clause is used to import data from CSV files.






Neo4j Write CQL Clauses


  1. CREATE
    • This clause is used to create nodes, relationships, and properties.
  2. MERGE
    • This clause verifies whether the specified pattern exists in the graph. If not, it creates the pattern.
  3. SET
    • This clause is used to update labels on nodes, properties on nodes and relationships.
  4. DELETE
    • This clause is used to delete nodes and relationships or paths etc. from the graph.
  5. REMOVE
    • This clause is used to remove properties and elements from nodes and relationships.
  6. FOREACH
    • This class is used to update the data within a list.
  7. CREATE UNIQUE
    • Using the clauses CREATE and MATCH, you can get a unique pattern by matching the existing pattern and creating the missing one.





Neo4j General CQL Clauses




  1. RETURN
    • This clause is used to define what to include in the query result set.
  2. ORDER BY
    • This clause is used to arrange the output of a query in order. It is used along with the clauses RETURN or WITH.
  3. LIMIT
    • This clause is used to limit the rows in the result to a specific value.
  4. SKIP
    • This clause is used to define from which row to start including the rows in the output.
  5. WITH
    • This clause is used to chain the query parts together.
  6. UNWIND
    • This clause is used to expand a list into a sequence of rows.
  7. UNION
    • This clause is used to combine the result of multiple queries.
  8. CALL
    • This clause is used to invoke a procedure deployed in the database.






Operators in Cypher Query Language




  • Mathematical +, -, *, /, %, ^
  • Comparison +, <>, <, >, <=, >=
  • Boolean AND, OR, XOR, NOT
  • String +
  • List +, IN, [X], [X…..Y]
  • Regular Expression =-
  • String matching STARTS WITH, ENDS WITH, CONSTRAINTS




No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services