Skip to content

Commit a7cd84a

Browse files
committed
Define apoc.coll.union
1 parent 5d9aceb commit a7cd84a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/database/query/cypher-functions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const fn =
1616
/** Create a function with a name that takes a single argument */
1717
const fn1 = (name: string) => (arg: ExpressionInput) => fn(name)(arg);
1818

19+
/** Create a function with a name that takes two arguments */
20+
const fn2 = (name: string) => (arg1: ExpressionInput, arg2: ExpressionInput) =>
21+
fn(name)(arg1, arg2);
22+
1923
const fn0 = (name: string) => () => fn(name)();
2024

2125
/**
@@ -78,6 +82,11 @@ export const apoc = {
7882
coll: {
7983
flatten: fn1('apoc.coll.flatten'),
8084
indexOf: fn('apoc.coll.indexOf'),
85+
/**
86+
* Returns the distinct union of the two given LIST<ANY> values.
87+
* @see https://neo4j.com/docs/apoc/current/overview/apoc.coll/apoc.coll.union/
88+
*/
89+
union: fn2('apoc.coll.union'),
8190
},
8291
convert: {
8392
/** Converts Neo4j node to object/map of the node's properties */

0 commit comments

Comments
 (0)