Four, Neo4j CQL commonly used function introduction

The last article mainly introduced the commonly used commands of Neo4j CQL, this article mainly introduced its commonly used functions. Follow the column "Knowledge Graph Series" to learn more about knowledge graphs~


table of Contents

One, string function

1.1 UPPER function

1.2 LOWER function

1.3 SUBSTRING function

Two, AGGREGATION aggregate function

2.1 COUNT function

2.2 MAX function

2.3 MIN function

2.4 AVG function

2.5 SUM function

Three, the relationship function


 

One, string function

Like SQL, Neo4J CQL provides a set of String functions for obtaining desired results in CQL queries. The list of commonly used string functions is as follows:

1.1 UPPER function

Convert letters to uppercase, the syntax is:

UPPER (<input-string>)

Among them, <input-string> can be the attribute name of the node or relationship from the Neo4J database.

1.2 LOWER function

Convert letters to lowercase letters, the syntax is:

LOWER (<input-string>)

1.3 SUBSTRING function

String interception function, the interception range is left closed and right open, the syntax is as follows:

SUBSTRING(<input-string>,<startIndex> ,<endIndex>)

Two, AGGREGATION aggregate function

Neo4j CQL provides some aggregate functions used in the RETURN clause, which is similar to the GROUP BY clause in SQL. The commonly used aggregate functions are as follows:

2.1 COUNT function

It gets the result from the MATCH clause, counts the number of rows that appear in the result, and returns the count value. The syntax is as follows:

COUNT(<value>)

2.2 MAX function

Maximum value function, the syntax is:

MAX(<property-name>)

2.3 MIN function

The minimum value function, the syntax is:

MIN(<property-name>)

2.4 AVG function

Average function, the syntax is:

AVG(<property-name>)

2.5 SUM function

The sum function, the syntax is:

SUM(<property-name>)

Three, the relationship function

Neo4j CQL provides a set of relationship functions to know the details of the relationship when getting the start node, end node and other details. The commonly used relational functions are as follows:

 

This article has come to an end, this article mainly describes some Neo4j CQL commonly used functions. What problems did you encounter in the process, welcome to leave a message, let me see what problems you all encountered~

Guess you like

Origin blog.csdn.net/gdkyxy2013/article/details/109577791