Name of the collection.
TODO
TODO
TODO
Retrieves the collection checksum.
TODO
Retrieves information about the number of documents in a collection.
Creates a collection with the given options
and the instance's name.
See also Database.createCollection and Database.createEdgeCollection.
Note: When called on an EdgeCollection instance in TypeScript,
the type
option must still be set to the correct CollectionType.
Otherwise this will result in the collection being created with the
default type (i.e. as a document collection).
Options for creating the collection.
Retrives the document matching the given key or id.
Throws an exception when passed a document or _id
from a different
collection, or if the document does not exist.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Options for retrieving the document.
Retrives the document matching the given key or id.
Throws an exception when passed a document or _id
from a different
collection, or if the document does not exist.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
If set to true
, null
is returned instead of an
exception being thrown if the document does not exist.
Checks whether a document matching the given key or id exists in this collection.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Derives a document _id
from the given selector for this collection.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Deletes the collection from the database.
Options for dropping the collection.
Deletes the index with the given name or id
from the database.
Index name, id or object with either property.
Retrieves a list of all edges of the document matching the given
selector
.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Creates a persistent index on the collection if it does not already exist.
Options for creating the persistent index.
Creates a hash index on the collection if it does not already exist.
When using the RocksDB storage engine, hash indexes behave identically to persistent indexes.
Options for creating the hash index.
Creates a skiplist index on the collection if it does not already exist.
When using the RocksDB storage engine, skiplist indexes behave identically to persistent indexes.
Options for creating the skiplist index.
Creates a TTL index on the collection if it does not already exist.
Options for creating the TTL index.
Creates a fulltext index on the collection if it does not already exist.
Options for creating the fulltext index.
Creates a geo index on the collection if it does not already exist.
Options for creating the geo index.
Checks whether the collection exists.
Retrieves statistics for a collection.
TODO
TODO
Retrieves general information about the collection.
TODO
Bulk imports the given data
into the collection.
The data to import, as an array of edge data.
Options for importing the data.
Bulk imports the given data
into the collection.
The data to import, as an array containing a single array of attribute names followed by one or more arrays of attribute values for each edge document.
Options for importing the data.
Bulk imports the given data
into the collection.
If type
is omitted, data
must contain one JSON array per line with
the first array providing the attribute names and all other arrays
providing attribute values for each edge document.
If type
is set to "documents"
, data
must contain one JSON document
per line.
If type
is set to "list"
, data
must contain a JSON array of
edge documents.
If type
is set to "auto"
, data
can be in either of the formats
supported by "documents"
or "list"
.
The data to import as a Buffer (Node), Blob (browser) or string.
Options for importing the data.
Retrieves a list of all incoming edges of the document matching the given
selector
.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Returns an index description by name or id
if it exists.
Index name, id or object with either property.
Returns a list of all index descriptions for the collection.
TODO
Instructs ArangoDB to load the collection into memory.
Whether the number of documents in the collection should be included in the server response. Disabling this may speed up this process in future versions of ArangoDB.
Instructs ArangoDB to load the collection into memory.
Whether the number of documents in the collection should be included in the server response. Disabling this may speed up this process in future versions of ArangoDB.
(RocksDB only.) Instructs ArangoDB to load as many indexes of the collection into memory as permitted by the memory limit.
TODO
Retrieves a list of all outgoing edges of the document matching the given
selector
.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Retrieves the collection's properties.
Replaces the properties of the collection.
(RocksDB only.) Instructs ArangoDB to recalculate the collection's document count to fix any inconsistencies.
Removes an existing document from the collection.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Options for removing the document.
Removes existing documents from the collection.
Throws an exception when passed any document or _id
from a different
collection.
Documents _key
, _id
or objects with either of those
properties (e.g. documents from this collection).
Options for removing the documents.
TODO
TODO
Renames the collection and updates the instance's name
to newName
.
Additionally removes the instance from the Database's internal cache.
Note: Renaming collections may not be supported when ArangoDB is running in a cluster configuration.
The new name of the collection.
Replaces an existing document in the collection.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
The contents of the new document.
Options for replacing the document.
Replaces existing documents in the collection, identified by the _key
or
_id
of each document.
The documents to replace.
Options for replacing the documents.
TODO
Retrieves the collection revision ID.
(MMFiles single-server only.) Rotates the journal of the collection.
Inserts a new document with the given data
into the collection.
The contents of the new document.
Options for inserting the document.
Inserts new documents with the given data
into the collection.
The contents of the new documents.
Options for inserting the documents.
Performs a traversal starting from the given startVertex
and following
edges contained in this edge collection.
Throws an exception when passed a document or _id
from a different
collection.
See also Graph.traversal.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
Options for performing the traversal.
Deletes all documents in the collection.
Instructs ArangoDB to remove the collection from memory.
Updates an existing document in the collection.
Throws an exception when passed a document or _id
from a different
collection.
Document _key
, _id
or object with either of those
properties (e.g. a document from this collection).
The data for updating the document.
Options for updating the document.
Updates existing documents in the collection, identified by the _key
or
_id
of each document.
The data for updating the documents.
Options for updating the documents.
const db = new Database();
const collection = db.collection("friends");
await collection.save(
{
_key: "musadir",
_from: "users/rana",
_to: "users/mudasir",
active: true,
best: true
}
);
await collection.save(
{
_key: "salman",
_from: "users/rana",
_to: "users/salman",
active: false,
best: false
}
);
const result = await collection.updateAll(
[
{ _key: "musadir", active: false },
{ _key: "salman", active: true, best: true }
],
{ returnNew: true }
);
console.log(result[0].new.active, result[0].new.best); // false true
console.log(result[1].new.active, result[1].new.best); // true true
TODO
Generated using TypeDoc
Represents an edge collection in a Database.
See DocumentCollection for a more generic variant of this interface more suited for regular document collections.