Options
All
  • Public
  • Public/Protected
  • All
Menu

Module graph

import type {
  Graph,
  GraphVertexCollection,
  GraphEdgeCollection,
} from "arangojs/graph";

The "graph" module provides graph related types and interfaces for TypeScript.

Index

Type aliases

AddEdgeDefinitionOptions

AddEdgeDefinitionOptions: { satellites?: (string | ArangoCollection)[] }

Type declaration

  • Optional satellites?: (string | ArangoCollection)[]

    (Enterprise Edition cluster only.) Collections to be included in a Hybrid SmartGraph.

AddVertexCollectionOptions

AddVertexCollectionOptions: { satellites?: (string | ArangoCollection)[] }

Type declaration

  • Optional satellites?: (string | ArangoCollection)[]

    (Enterprise Edition cluster only.) Collections to be included in a Hybrid SmartGraph.

EdgeDefinition

EdgeDefinition: { collection: string; from: string[]; to: string[] }

Definition of a relation in a Graph.

Type declaration

  • collection: string

    Name of the collection containing the edges.

  • from: string[]

    Array of names of collections containing the start vertices.

  • to: string[]

    Array of names of collections containing the end vertices.

EdgeDefinitionOptions

EdgeDefinitionOptions: { collection: string | ArangoCollection; from: (string | ArangoCollection)[] | string | ArangoCollection; to: (string | ArangoCollection)[] | string | ArangoCollection }

An edge definition used to define a collection of edges in a Graph.

Type declaration

GraphCollectionInsertOptions

GraphCollectionInsertOptions: { returnNew?: boolean; waitForSync?: boolean }

Options for inserting a document into a graph collection.

Type declaration

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

GraphCollectionReadOptions

GraphCollectionReadOptions: { allowDirtyRead?: boolean; graceful?: boolean; rev?: string }

Options for retrieving a document from a graph collection.

Type declaration

  • Optional allowDirtyRead?: boolean

    If set to true, the request will explicitly permit ArangoDB to return a potentially dirty or stale result and arangojs will load balance the request without distinguishing between leaders and followers.

    Default: false

  • Optional graceful?: boolean

    If set to true, null is returned instead of an exception being thrown if the document does not exist.

    Default: false

  • Optional rev?: string

    If set to a document revision, the document will only be returned if its _rev property matches this value.

    See also DocumentMetadata.

GraphCollectionRemoveOptions

GraphCollectionRemoveOptions: { returnOld?: boolean; rev?: string; waitForSync?: boolean }

Options for removing a document from a graph collection.

Type declaration

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object.

    Default: false

  • Optional rev?: string

    If set to a document revision, the document will only be removed if its _rev property matches this value.

    See also DocumentMetadata.

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

GraphCollectionReplaceOptions

GraphCollectionReplaceOptions: { keepNull?: boolean; returnNew?: boolean; returnOld?: boolean; rev?: string; waitForSync?: boolean }

Options for replacing a document in a graph collection.

Type declaration

  • Optional keepNull?: boolean

    If set to false, properties with a value of null will be removed from the new document.

    Default: true

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object.

    Default: false

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object.

    Default: false

  • Optional rev?: string

    If set to a document revision, the document will only be modified if its _rev property matches this value.

    See also DocumentMetadata.

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

GraphCreateOptions

GraphCreateOptions: { isDisjoint?: boolean; isSmart?: boolean; minReplicationFactor?: number; numberOfShards?: number; orphanCollections?: (string | ArangoCollection)[] | string | ArangoCollection; replicationFactor?: number | "satellite"; satellites?: (string | ArangoCollection)[]; smartGraphAttribute?: string; waitForSync?: boolean; writeConcern?: number }

Option for creating a graph.

Type declaration

  • Optional isDisjoint?: boolean

    (Enterprise Edition cluster only.) If set to true, the graph will be created as a Disjoint SmartGraph.

    Default: false

  • Optional isSmart?: boolean

    (Enterprise Edition cluster only.) If set to true, the graph will be created as a SmartGraph.

    Default: false

  • Optional minReplicationFactor?: number

    (Cluster only.) Write concern for new collections in the graph.

    Has no effect when replicationFactor is set to "satellite".

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • Optional numberOfShards?: number

    (Cluster only.) Number of shards that is used for every collection within this graph.

    Has no effect when replicationFactor is set to "satellite".

  • Optional orphanCollections?: (string | ArangoCollection)[] | string | ArangoCollection

    Additional vertex collections. Documents within these collections do not have edges within this graph.

  • Optional replicationFactor?: number | "satellite"

    (Cluster only.) Replication factor used when initially creating collections for this graph.

    Default: 1

  • Optional satellites?: (string | ArangoCollection)[]

    (Enterprise Edition cluster only.) Collections to be included in a Hybrid SmartGraph.

  • Optional smartGraphAttribute?: string

    (Enterprise Edition cluster only.) Attribute containing the shard key value to use for smart sharding.

    Note: isSmart must be set to true.

  • Optional waitForSync?: boolean

    If set to true, the request will wait until all modifications have been synchronized to disk before returning successfully.

    Default: false

  • Optional writeConcern?: number

    (Cluster only.) Write concern for new collections in the graph.

    Has no effect when replicationFactor is set to "satellite".

GraphInfo

GraphInfo: { _id: string; _key: string; _rev: string; edgeDefinitions: EdgeDefinition[]; isDisjoint?: boolean; isSatellite?: boolean; isSmart?: boolean; minReplicationFactor?: number; name: string; numberOfShards?: number; orphanCollections: string[]; replicationFactor?: number; smartGraphAttribute?: string; writeConcern?: number }

General information about a graph.

Type declaration

  • _id: string

    Unique identifier of the document internally representing this graph.

    See DocumentMetadata.

    internal
  • _key: string

    Key of the document internally representing this graph.

    See DocumentMetadata.

    internal
  • _rev: string

    Revision of the document internally representing this graph.

    See DocumentMetadata.

    internal
  • edgeDefinitions: EdgeDefinition[]

    Definitions for the relations of the graph.

  • Optional isDisjoint?: boolean

    (Enterprise Edition cluster only.) If set to true, the graph has been created as a Disjoint SmartGraph.

  • Optional isSatellite?: boolean

    (Enterprise Edition cluster only.) If set to true, the graph is a SatelliteGraph.

  • Optional isSmart?: boolean

    (Enterprise Edition cluster only.) If set to true, the graph has been created as a SmartGraph.

  • Optional minReplicationFactor?: number

    (Cluster only.) Write concern for new collections in the graph.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • name: string

    Name of the graph.

  • Optional numberOfShards?: number

    (Cluster only.) Number of shards that is used for every collection within this graph.

  • orphanCollections: string[]

    Additional vertex collections. Documents within these collections do not have edges within this graph.

  • Optional replicationFactor?: number

    (Cluster only.) Replication factor used when initially creating collections for this graph.

  • Optional smartGraphAttribute?: string

    (Enterprise Edition cluster only.) Attribute containing the shard key value to use for smart sharding.

  • Optional writeConcern?: number

    (Cluster only.) Write concern for new collections in the graph.

ReplaceEdgeDefinitionOptions

ReplaceEdgeDefinitionOptions: { satellites?: string[] }

Type declaration

  • Optional satellites?: string[]

    (Enterprise Edition cluster only.) Collections to be included in a Hybrid SmartGraph.

Functions

isArangoGraph

  • isArangoGraph(graph: any): graph is Graph
  • Indicates whether the given value represents a Graph.

    Parameters

    • graph: any

      A value that might be a Graph.

    Returns graph is Graph

Generated using TypeDoc