Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T16:38:28.000Z (14 days ago)
- Last Synced: 2025-01-07T17:52:39.017Z (14 days ago)
- Topics: cypher, cypher-query-language, javascript, neo4j, query-builder, typescript
- Language: TypeScript
- Homepage: https://neo4j.github.io/cypher-builder/
- Size: 1.73 MB
- Stars: 55
- Watchers: 7
- Forks: 14
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cypher Builder
[![npm version](https://badge.fury.io/js/@neo4j%2Fcypher-builder.svg)](https://www.npmjs.com/package/@neo4j/cypher-builder)
[![Test](https://github.com/neo4j/cypher-builder/actions/workflows/test.yml/badge.svg)](https://github.com/neo4j/cypher-builder/actions/workflows/test.yml)
[![Lint](https://github.com/neo4j/cypher-builder/actions/workflows/lint.yml/badge.svg)](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).