Skip to content

Commit 5d4d689

Browse files
authored
Merge pull request #572 from neo4j/remove-deprecated-functions
Remove functions deprecated in Cypher 5
2 parents 86b7d1e + 9153289 commit 5d4d689

File tree

5 files changed

+9
-35
lines changed

5 files changed

+9
-35
lines changed

.changeset/thin-radios-poke.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@neo4j/cypher-builder": major
3+
---
4+
5+
Remove functions deprecated in Cypher 5:
6+
7+
- `distance` in favor of `point.distance`
8+
- `id` in favor of `elementId`

src/expressions/functions/scalar.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ describe("Scalar Functions", () => {
3131

3232
// 1 parameter functions
3333
test.each([
34-
"id",
3534
"elementId",
3635
"endNode",
3736
"size",

src/expressions/functions/scalar.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ export function head(expr: Expr): CypherFunction {
5858
return new CypherFunction("head", [expr]);
5959
}
6060

61-
/**
62-
* @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-id | Cypher Documentation}
63-
* @group Functions
64-
* @category Scalar
65-
* @deprecated Use {@link elementId} instead
66-
*/
67-
export function id(variable: Expr): CypherFunction {
68-
return new CypherFunction("id", [variable]);
69-
}
70-
7161
/**
7262
* @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-last | Cypher Documentation}
7363
* @group Functions

src/expressions/functions/spatial.test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,10 @@
1717
* limitations under the License.
1818
*/
1919

20-
import { TestClause } from "../../utils/TestClause";
2120
import Cypher from "../..";
21+
import { TestClause } from "../../utils/TestClause";
2222

2323
describe("Spatial Functions", () => {
24-
describe("4.x deprecated functions", () => {
25-
test.each(["distance"] as const)("%s", (value) => {
26-
const leftExpr = new Cypher.Variable();
27-
const rightExpr = new Cypher.Variable();
28-
const spatialFn = Cypher[value](leftExpr, rightExpr);
29-
30-
const queryResult = new TestClause(spatialFn).build();
31-
32-
expect(queryResult.cypher).toBe(`${value}(var0, var1)`);
33-
expect(queryResult.params).toEqual({});
34-
});
35-
});
36-
3724
test("point function", () => {
3825
const pointFn = Cypher.point(new Cypher.Variable());
3926

src/expressions/functions/spatial.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ export function point(variable: Expr): CypherFunction {
2929
return new CypherFunction("point", [variable]);
3030
}
3131

32-
/**
33-
* @see {@link https://neo4j.com/docs/cypher-manual/4.3/functions/spatial/#functions-distance | Cypher Documentation}
34-
* @group Functions
35-
* @category Spatial
36-
* @deprecated No longer supported in Neo4j 5. Use {@link point.distance} instead.
37-
*/
38-
export function distance(lexpr: Expr, rexpr: Expr): CypherFunction {
39-
return new CypherFunction("distance", [lexpr, rexpr]);
40-
}
41-
4232
/**
4333
* @see {@link https://neo4j.com/docs/cypher-manual/current/functions/spatial/#functions-distance | Cypher Documentation}
4434
* @group Functions

0 commit comments

Comments
 (0)