1
0
Fork 0
arangodb/Documentation/Books/Drivers/JS/Reference/Collection
Wilfried Goesgens 8c39f9f666 Doc - fix links (#5739) 2018-07-02 13:56:09 +02:00
..
BulkImport.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
CollectionManipulation.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
DocumentCollection.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
DocumentManipulation.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
EdgeCollection.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
Indexes.md Doc - fix links (#5739) 2018-07-02 13:56:09 +02:00
README.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00
SimpleQueries.md Doc - New pages: "Starter Architecture" & "Securing Starter Deployments" + Sync from external repos (#5666) 2018-06-28 17:14:56 +02:00

README.md

Collection API

These functions implement the HTTP API for manipulating collections.

The Collection API is implemented by all Collection instances, regardless of their specific type. I.e. it represents a shared subset between instances of DocumentCollection, EdgeCollection, GraphVertexCollection and GraphEdgeCollection.

Getting information about the collection

See the HTTP API documentation for details.

collection.exists

async collection.exists(): boolean

Checks whether the collection exists.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const result = await collection.exists();
// result indicates whether the collection exists

collection.get

async collection.get(): Object

Retrieves general information about the collection.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.get();
// data contains general information about the collection

collection.properties

async collection.properties(): Object

Retrieves the collection's properties.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.properties();
// data contains the collection's properties

collection.count

async collection.count(): Object

Retrieves information about the number of documents in a collection.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.count();
// data contains the collection's count

collection.figures

async collection.figures(): Object

Retrieves statistics for a collection.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.figures();
// data contains the collection's figures

collection.revision

async collection.revision(): Object

Retrieves the collection revision ID.

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.revision();
// data contains the collection's revision

collection.checksum

async collection.checksum([opts]): Object

Retrieves the collection checksum.

Arguments

Examples

const db = new Database();
const collection = db.collection('some-collection');
const data = await collection.checksum();
// data contains the collection's checksum