- Neo4j Tutorial
- Neo4j - Home
- Neo4j - Overview
- Neo4j - Data Model
- Neo4j - Environment Setup
- Neo4j - Building Blocks
- Neo4j CQL Write Clauses
- Neo4j - Merge Command
- Neo4j - Set Clause
- Neo4j - Delete Clause
- Neo4j - Remove Clause
- Neo4j - Foreach Clause
- Neo4j CQL Read Clause
- Neo4j - Match Clause
- Neo4j - Optional Match Clause
- Neo4j - Where Clause
- Neo4j - Count Function
- Neo4j CQL General Clauses
- Neo4j - Return Clause
- Neo4j - Order By Clause
- Neo4j - Limit Clause
- Neo4j - Skip Clause
- Neo4j - With Clause
- Neo4j - Unwind Clause
- Neo4j CQL Functions
- Neo4j - String Functions
- Neo4j - Aggregation Function
- Neo4j CQL Admin
- Neo4j - Backup & Restore
- Neo4j - Index
- Neo4j - Create Unique Constraint
- Neo4j - Drop Unique
- Neo4j Useful Resources
- Neo4j - Quick Guide
- Neo4j - Useful Resources
- Neo4j - Discussion
Neo4j CQL - RETURN Clause
Neo4j CQL RETURN clause is used -
- To retrieve some properties of a Node
- To retrieve all properties of a Node
- To retrieve some properties of Nodes and associated Relationships
- To retrieve all properties of Nodes and associated relationships
RETURN command syntax:
RETURN <node-name>.<property1-name>, ........ <node-name>.<propertyn-name>
Syntax Description
Syntax Element | Description |
---|---|
<node-name> | It is a node name we are going to create. |
<Property1-name>...<Propertyn-name> | Properties are key-value pairs. <Property-name> defines the name of the property which is going to assign to a creating Node |
Example
This Example demonstrates On "What will happen if we use RETURN command alone to retrieve data from Database". Follow the steps given below -
Step 1 - Open Neo4j Data Browser.
Step 2 - Type the below command at dollar prompt in Data Browser.
RETURN dept.deptno
Here -
- dept is a node name
- deptno is a property name of dept node
Step 3 - Click on Execute button and see the success message in the Data Browser.
If you observe the error message, it tells us that we cannot use RETURN clause alone. We should use it with either MATCH or CREATE Commands.
In next section, we will discuss about how to use RETURN clause with MATCH Command to retrieve data from Database.
Advertisements