# neo4j-qb

> Neo4j Query Builder

Latest version **1.1.6** (published 2017-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install neo4j-qb
pnpm add neo4j-qb
yarn add neo4j-qb
bun add neo4j-qb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2017-08-09 |
| First published | 2017-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian Osuna |
| Maintainers | jsebastianosuna |
| Keywords | neo4j, query, builder |

## Links

- npm: https://www.npmjs.com/package/neo4j-qb
- Repository: https://github.com/SebastianOsuna/neo4j-qb
- Homepage: https://github.com/SebastianOsuna/neo4j-qb#readme
- Issues: https://github.com/SebastianOsuna/neo4j-qb/issues
- npm.io page: https://npm.io/package/neo4j-qb

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2.6.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [lodash.omit](https://npm.io/package/lodash.omit.md) ^4.5.0

## Recent versions

- 1.1.6 (latest) — 2017-08-09
- 1.1.5 — 2017-04-17
- 1.1.4 — 2017-02-20
- 1.1.1 — 2017-02-20
- 1.1.0 — 2017-02-20
- 1.0.7 — 2017-02-14
- 1.0.6 — 2017-02-14
- 1.0.5 — 2017-02-14
- 1.0.4 — 2017-02-14
- 1.0.3 — 2017-02-14
- 1.0.2 — 2017-02-14
- 1.0.1 — 2017-02-13
- 1.0.0 — 2017-02-13

## 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 = 'jhon@example.com' ON MATCH SET n.email = 'jhon@example.com'
qb.upsert({ email: 'jhon@example.com' }, { 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');
```

---
_Source: https://npm.io/package/neo4j-qb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
