dedup()
Function dedup() deduplicates rows of an alias and return the rows left. Those homologous aliases of the input alias will either be affected by the deduplication process when the function is called in a WITH clause, or not be affected when called in a RETURN clause.
Arguments:
Returns:
Sample graph: (to be used for the following examples)
Run below UQLs one by one in an empty graphset to create graph data:
```customlang___fold__lang_uql
create().node_schema("professor").node_schema("student")
create().node_property(@*, "age", int32).node_property(@*, "email", string)
insert().into(@professor).nodes([{_id:"P001",_uuid:1,age:53,email:"
[email protected]"},{_id:"P002",_uuid:2,age:27,email:"
[email protected]"}])
insert().into(@student).nodes([{_id:"S001",_uuid:3,age:27,email:"
[email protected]"},{_id:"S002",_uuid:4,age:20,email:"
[email protected]"},{_id:"S003",_uuid:5,age:25,email:"
[email protected]"}])
```
Common Usage
Example: Calculate the deduplicated age of all nodes in the graph
find().nodes() as n
return dedup(n.age)