Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ArangoDBAdapter

Hierarchy

  • DatabaseAdapter
  • DatabaseAdapter
    • ArangoDBAdapter

Index

Constructors

constructor

Properties

client

client: Database

listeners

listeners: EventListener[] = []

name

  • get name(): string
  • set name(name: string): void

password

  • set password(password: string): void
  • Parameters

    • password: string

    Returns void

user

  • get user(): string
  • set user(user: string): void

Accessors

maxListeners

  • get maxListeners(): number
  • set maxListeners(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

Methods

createCollection

  • createCollection(collection: string): Promise<boolean>
  • Parameters

    • collection: string

    Returns Promise<boolean>

createDatabase

  • createDatabase(database?: string): Promise<boolean>
  • Parameters

    • Optional database: string

    Returns Promise<boolean>

decode

  • decode(collection: string, data: object): RecordData
  • Parameters

    • collection: string
    • data: object

    Returns RecordData

dropCollection

  • dropCollection(collection: string): Promise<boolean>
  • Parameters

    • collection: string

    Returns Promise<boolean>

dropDatabase

  • dropDatabase(database?: string): Promise<boolean>
  • Parameters

    • Optional database: string

    Returns Promise<boolean>

emit

  • emit(namespace: string, ...data: any[]): void
  • Parameters

    • namespace: string
    • Rest ...data: any[]

    Returns void

encode

  • encode(collection: string, data: RecordData): object
  • Parameters

    • collection: string
    • data: RecordData

    Returns object

ensureCollectionExists

  • ensureCollectionExists(collection: string): Promise<boolean>
  • Parameters

    • collection: string

    Returns Promise<boolean>

ensureDatabaseExists

  • ensureDatabaseExists(database?: string): Promise<boolean>
  • Parameters

    • Optional database: string

    Returns Promise<boolean>

findAll

  • findAll(collection: string, query?: Query): Promise<RecordData[]>
  • Parameters

    • collection: string
    • Optional query: Query

    Returns Promise<RecordData[]>

get

  • get(collection: string, id: string): Promise<RecordData>
  • Parameters

    • collection: string
    • id: string

    Returns Promise<RecordData>

getCollectionNames

  • getCollectionNames(database?: string): Promise<string[]>
  • Parameters

    • Optional database: string

    Returns Promise<string[]>

getDatabaseNames

  • getDatabaseNames(): Promise<string[]>
  • Returns Promise<string[]>

insert

  • insert(collection: string, data: RecordData): Promise<RecordData>
  • Parameters

    • collection: string
    • data: RecordData

    Returns Promise<RecordData>

insertAll

  • insertAll(collection: string, data: RecordData[]): Promise<RecordData[]>
  • Parameters

    • collection: string
    • data: RecordData[]

    Returns Promise<RecordData[]>

load

  • load(): Promise<boolean>
  • Returns Promise<boolean>

on

  • on(namespace: string | RegExp, callback: Function, once?: boolean): EventListener
  • Subscribe a callable function to a namespace.

    Parameters

    • namespace: string | RegExp
    • callback: Function
    • Default value once: boolean = false

    Returns EventListener

    Used to manage the subscription status via open and close methods.

once

  • once(namespace: string | RegExp, callback: Function): EventListener
  • Subscribe a callable function to a namespace, for exactly one execution.

    Parameters

    • namespace: string | RegExp
    • callback: Function

    Returns EventListener

    Used to manage the subscription status via open and close methods.

pop

  • pop(listener: EventListener): boolean
  • Remove a Listener instance from the EventNamespace instance. Called with unsubscribe method.

    Parameters

    • listener: EventListener

    Returns boolean

    A true value indicates a successful pop.

push

  • push(listener: EventListener): void
  • Add a Listener instance to the EventNamespace instance. Called with subscribe method.

    Parameters

    • listener: EventListener

    Returns void

queryToAQL

  • queryToAQL(collection: any, query: Query): string
  • Parse a Query instance into an AQL string

    Parameters

    • collection: any

      The collection to execute the query on.

    • query: Query

      The Query instance.

    Returns string

    The AQL string.

remove

  • remove(collection: string, data: string | RecordData): Promise<RecordData>
  • Parameters

    • collection: string
    • data: string | RecordData

    Returns Promise<RecordData>

replace

  • replace(collection: string, id: string, data: RecordData, rev?: string): Promise<RecordData>
  • Parameters

    • collection: string
    • id: string
    • data: RecordData
    • Optional rev: string

    Returns Promise<RecordData>

truncateCollection

  • truncateCollection(collection: string): Promise<boolean>
  • Parameters

    • collection: string

    Returns Promise<boolean>

truncateDatabase

  • truncateDatabase(): Promise<boolean>
  • Returns Promise<boolean>

update

  • update(collection: string, id: string, data: RecordData): Promise<RecordData>
  • Parameters

    • collection: string
    • id: string
    • data: RecordData

    Returns Promise<RecordData>