Skip to main content
Module

x/darango/collection.ts>Collection

An ArangoDB driver for Deno.
Go to Latest
class Collection
import { Collection } from "https://deno.land/x/darango@0.0.4/collection.ts";

An object representing a collection on the ArangoDB server.

Constructors

new
Collection(ax: axiod, name: string)

Methods

private
deleteDocument(key: string): Promise<boolean>
private
updateDocument(key: string, data: DocumentData<T>): Promise<void>
create(data: T): Promise<Document<T>>

Create a new document in the collection.

find(filter: Partial<DocumentData<T>>): Promise<Document<T>[]>

Find multiple documents matching the filter provided.

findOne(filter: Partial<DocumentData<T>>): Promise<Document<T> | undefined>

Find the first document matching the filter provided.

get(key: string): Promise<Document<T>>

Get a document directly by its key

query(aql: string, options?: CursorOptions): Promise<Document<T>[]>

Run a query, returning the results as Document objects.

truncate(): Promise<void>

Truncate the collection.