Awesome Open Source
Awesome Open Source

Deprecated: Orango is no longer being maintained


ArangoDB Object Modeling for Node.js, Foxx and Modern Web Browsers

Downloads Version License Build Status Coverage Status Commitizen Friendly

Orango is an ODM (Object Data Modeler), an ORM (Object Relational Mapper) and an OGM (Object Graphical Mapper) in one that provides the following features:

  • Central connectivity to ArangoDB
  • Automated creation of collections and indexes
  • Create schemas for data
  • Interact with models to handle data-centric functionality
  • Pre-populate database
  • Graph linking and querying
  • and more...

Why use Orango with ArangoDB?

  • Ease of use
  • Model-driven data
  • Focus on data instead of queries
  • Optimized query creation
  • Validation
  • Filter unknown data from being injected into database
  • Cleaner interfaces
  • Single point of change for bug fixes, features, etc
  • Save on redundancy - DRY implementation
  • Default values
  • and more...

Community Support

Join the Orango community

Documentation & Articles

Official documentation can be found at (This is a work in progress)

I will be regularly posting articles on (Medium). Follow me there

Follow me on Twitter for updates


First be sure you have ArangoDB and Node.js installed. You can install ArangoDB using the official docker container.

Next, install Orango from the command line using npm:

$ npm install orango


// Using Node.js `require()`
const orango = require('orango')

// Using ES6 imports
import orango from 'orango'


Connecting to ArangoDB

First, we need to define a connection. If your app uses the default _system database, you can connect using orango.connect(). If you need to create additional connections, use orango.get( database:String ).connect().

The method connect([{url:String="http://localhost:8529", username:String, password:String}]) takes database name with options to establish a connection. Otherwise, it will use the default values.

const orango = require('orango')
const { EVENTS } = orango.consts, conn => {
   console.log('🥑  Connected to ArangoDB:', conn.url + '/' +
}), () => {
   console.log('🍊  Orango is ready!')

async function main() {
   await orango.connect()


Note: Orango buffers model definitions, so they can be defined before or after a connection is established.

Defining a Model

const schema = new orango.Schema({
  author: String,
  title: String,
  body: String,
  date: Date

orango.model('Blog', schema)

Aside from defining the structure of your documents and data types, Orango models can handle the definition of:

  • Validators
  • Default values
  • Indexes
  • Static methods
  • Computed properties
  • Hooks
  • Custom queries
  • Unknown property filters
  • JSON to model structures
  • Joi definitions

The following example shows some of these features:

const Joi = require('joi')
const { SCHEMA } = orango.consts
class UserSchema extends orango.Schema {
  // computed properties
  get fullName() {
    return (this.firstName + ' ' + this.lastName).trim()

let schema = new UserSchema({
  firstName: String,
  lastName: String,
  // Joi can be used directly
  email: Joi.string().email(),
  // JSON gets converted to Joi data types automatically
  age: { type: Number, min: 18 },
  bio: { type: String, regex: /[a-z]/ },
  // default values are supported on insert and update
  created: { type: Date, default: },
  updated: { type: Date, defaultOnUpdate: }

schema.addIndex(SCHEMA.INDEX.HASH, 'email')
schema.addIndex(SCHEMA.INDEX.SKIP_LIST, ['firstName', 'lastName'])

let User = orango.model('User', schema)

// extend your model with custom functions
User.findByEmail = async function(email) {
  return await this.find().one().where({ email })

In code somewhere else

const User = orango.model('User')


let user = await User.findByEmail('[email protected]').return({ model: true })
console.log('Hello,', // access model getter


A growing set of examples are available here. To run the examples, clone this project and then run the Orango docker containers.

Install dependencies

npm install

Run the docker containers provided by Orango

Linux and Mac

Run the ArangoDB containers provided by Orango.

$ make dbs


$ cd docker & docker-compose up -d

Run examples

npm run examples

You will be presented with a wizard where you can run different examples files.

Terminal Screenshot

Debugging the examples with VSCode

Setup your config like the example below. You can launch any number of the snippets by placing the snippet you would like to start in the args array. Then run the debugger. The output will be in the Debug Console.

  "version": "0.2.0",
  "configurations": [
      "type": "node",
      "request": "launch",
      "name": "Count",
      "program": "${workspaceFolder}/examples/debug.js",
      "args": ["count"]
      "type": "node",
      "request": "launch",
      "name": "Find First",
      "program": "${workspaceFolder}/examples/debug.js",
      "args": ["find_first"]



Copyright (c) 2018-present, Rob Taylor

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,061,746
Graphql (15,752
Orm (5,876
Nosql (2,296
Odm (734
Joi (596
Arangodb (439
Orm Library (61
Ogm (24
Arango (16
Foxx (10