Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianosuna/neo4j-qb
Neo4J query builder
https://github.com/sebastianosuna/neo4j-qb
neo4j query-builder
Last synced: 3 days ago
JSON representation
Neo4J query builder
- Host: GitHub
- URL: https://github.com/sebastianosuna/neo4j-qb
- Owner: SebastianOsuna
- Created: 2017-02-09T15:31:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-09T18:51:13.000Z (over 7 years ago)
- Last Synced: 2024-12-20T20:48:44.709Z (4 days ago)
- Topics: neo4j, query-builder
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Neo4J Query builder
===*Written in ES5 for older nodejs version support.*
```
npm install neo4j-qb
```## Usage
```javascript
var Neo = require('neo4j-qb');
var qb = Neo(host, username, password, options);
```**options.connectionPoolSize**: Size of the connection pool.
### Insert
```javascript
// CREATE (:User {name: 'Jhon'})
qb.insert({ name: 'Jhon' }, 'User').then(...)
// MERGE (:User {name: 'Jhon'})
qb.upsert(null, { name: 'Jhon' }, 'User').then(...);
// MERGE (n:User {name: 'Jhon'}) ON CREATE SET n.email = '[email protected]' ON MATCH SET n.email = '[email protected]'
qb.upsert({ email: '[email protected]' }, { name: 'Jhon' }, 'User').then(...);
```### Match
```javascript
// MATCH (u:User {id: 1}) RETURN n.id
qb.match('User', { id: 1 }, 'u').fetch('n.id').then(...);// MATCH (u:User)-[f:FRIEND_OF]->(u2:User) WHERE u.name = 'Jhon' RETURN f.since
qb.path(function (q) {
q.node('User', 'u').rrel('FRIEND_OF', 'f').node('User', 'u2');
})
.where('u.name', '=', 'Jhon')
.fetch('f.since');
```