1
0
Fork 0
arangodb/Documentation/Books/Drivers/JS/Reference/Collection
Simran f816597e84
Doc - Sync external repos 2019-03-13 (devel) (#8405)
2019-03-13 23:00:43 +01:00
..
BulkImport.md Doc - sync external repositories (#7616) 2018-12-05 18:49:11 +01:00
CollectionManipulation.md Doc - sync 2018-10-02 (rename arangodbjs to arangojs) (#6680) 2018-10-02 16:31:18 +02:00
DocumentCollection.md Doc - Sync external repos 2019-03-13 (devel) (#8405) 2019-03-13 23:00:43 +01:00
DocumentManipulation.md Doc - sync 2018-10-02 (rename arangodbjs to arangojs) (#6680) 2018-10-02 16:31:18 +02:00
EdgeCollection.md Doc - Sync external repos 2019-03-13 (devel) (#8405) 2019-03-13 23:00:43 +01:00
Indexes.md Named indices (#8370) 2019-03-13 18:20:32 +01:00
README.md Doc - sync 2018-10-02 (rename arangodbjs to arangojs) (#6680) 2018-10-02 16:31:18 +02:00
SimpleQueries.md Doc - sync 2018-10-02 (rename arangodbjs to arangojs) (#6680) 2018-10-02 16:31:18 +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