1.2.0 • Published 2 years ago

acoa v1.2.0

Weekly downloads
9
License
ISC
Repository
github
Last release
2 years ago

ACOA

Arango Collection Object Adapter

logo

Install

npm i -S acoa

At a glance

ACOA is an object document mapper (ODM) for Arangodb: it provides a set of utilities allowing to manipulate collection through js classes and objects.

Take a quick look at a way to use it :

const { createDocumentCollection } = require('acoa')
const dbLink = require('./db_link')

const Item = createDocumentCollection(dbLink, 'items')

new Item({
  reference: 'TRU-5656',
  name: 'wrist brace',
  description: 'Wrist protection for active people'
})
  .$save()
  .then(it => console.log(`item ${it.$id} successfully inserted`))
Item.get('items/uydgldq467qsde89==')
  .then(it => console.log(`item ${it.reference} successfully fetched`))
Item.findByDescriptionMatching(/wrist/i)
  .sortByNameAsc()
  .slice(20, 30)
  .run()
  .then(
    results =>
      results.forEach(
        ({ $id, reference, name }) =>
          console.log(`${$id} | ${$reference} | ${name}`)
      )
  )

For more details see the documentation

1.2.0

2 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago