https://github.com/neo4j/cypher-builder
A library for building Cypher queries for Neo4j programmatically.
https://github.com/neo4j/cypher-builder
cypher cypher-query-language javascript neo4j query-builder typescript
Last synced: 14 days ago
JSON representation
A library for building Cypher queries for Neo4j programmatically.
- Host: GitHub
- URL: https://github.com/neo4j/cypher-builder
- Owner: neo4j
- License: apache-2.0
- Created: 2022-12-01T14:43:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-03T12:39:43.000Z (24 days ago)
- Last Synced: 2025-04-04T03:03:57.918Z (23 days ago)
- Topics: cypher, cypher-query-language, javascript, neo4j, query-builder, typescript
- Language: TypeScript
- Homepage: https://neo4j.github.io/cypher-builder/
- Size: 1.86 MB
- Stars: 58
- Watchers: 5
- Forks: 16
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cypher Builder
[](https://www.npmjs.com/package/@neo4j/cypher-builder)
[](https://github.com/neo4j/cypher-builder/actions/workflows/test.yml)
[](https://github.com/neo4j/cypher-builder/actions/workflows/lint.yml)Cypher Builder is a JavaScript programmatic API to create [Cypher](https://neo4j.com/docs/cypher-manual/current/) queries for [Neo4j](https://neo4j.com/).
- [Documentation](https://neo4j.github.io/cypher-builder/cypher-builder/current/)
```typescript
import Cypher from "@neo4j/cypher-builder";const movieNode = new Cypher.Node();
const pattern = new Cypher.Pattern(movieNode, { labels: ["Movie"] });const matchQuery = new Cypher.Match(pattern)
.where(movieNode, {
title: new Cypher.Param("The Matrix"),
})
.return(movieNode.property("title"));const { cypher, params } = matchQuery.build();
console.log(cypher);
console.log(params);
```_Cypher_
```cypher
MATCH (this0:Movie)
WHERE this0.title = $param0
RETURN this0.title
```_Params_
```typescript
{
"param0": "The Matrix",
}
```# Examples
You can find usage examples in the [examples](https://github.com/neo4j/cypher-builder/tree/main/examples) folder.
> This library is for JavaScript and TypeScript only. If you are using Java, check [Neo4j Cypher DSL](https://neo4j.github.io/cypher-dsl).