# arangolize

> Sequelize-like query-builder for ArangoDB

Latest version **0.10.2** (published 2019-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install arangolize
pnpm add arangolize
yarn add arangolize
bun add arangolize
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.2 |
| Published | 2019-08-31 |
| First published | 2018-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Noah Gray |
| Maintainers | noah-kun |

## Links

- npm: https://www.npmjs.com/package/arangolize
- Repository: https://github.com/OKNoah/final/tree/master/packages/arangolize
- npm.io page: https://npm.io/package/arangolize

## Dependencies (2)

- [@babel/register](https://npm.io/package/@babel/register.md) ^7.0.0-beta.39
- [core-decorators](https://npm.io/package/core-decorators.md) ^0.20.0

## Recent versions

- 0.10.2 (latest) — 2019-08-31
- 0.10.1 — 2019-08-31
- 0.9.8 — 2018-03-25
- 0.9.7 — 2018-03-25
- 0.9.6 — 2018-03-24
- 0.9.5 — 2018-03-24
- 0.9.4 — 2018-03-22
- 0.9.3 — 2018-01-10
- 0.9.2 — 2018-01-10
- 0.9.1 — 2018-01-10

## README

# Arangolize

This tool builds find queries in a Sequelize-like way.

## Usage

```js
import arangolize from 'arangolize'
import { Database } from 'arangojs'

/*
  You'll need to get the database and collection yourself.
  This tool just builds the query and bindVars object.

  const db = new Database()... etc
*/

async function getDocument () {
  const { query, bindVars } = await arangolize({
    collection: 'Posts', // collection name
    limit: 10, // limits to 10 results
    skip: 10, // skip the first 10 results
    sort: '_createdAt DESC', // sort by `_createdAt` attribute, descending
    where: { body: 'I ❤️ Arango' }, // find based on keys and values. All must match
    include: [{
      as: 'user' // take the value of field `user` and populate it with the corresponding document
      // `user` field bust be valid ArangoID
    }]
  })

  // now use the qeury and bindVars as you normally would
  const data = await collection.query({ query, bindVars })

  return data
}
```

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