Monarch Database API - v1.0.0
    Preparing search index...

    Class GraphDatabase

    High-performance Graph Database

    Index

    Constructors

    Methods

    • Create an edge/relationship

      Parameters

      • from: string
      • to: string
      • Optionaltype: string
      • properties: Record<string, any> = {}

      Returns string

    • Create a node

      Parameters

      • Optionallabel: string
      • properties: Record<string, any> = {}

      Returns string

    • Delete an edge

      Parameters

      • edgeId: string

      Returns boolean

    • Delete a node and all connected edges

      Parameters

      • nodeId: string

      Returns boolean

    • Find nodes by label

      Parameters

      • label: string

      Returns GraphNode[]

    • Find nodes by property

      Parameters

      • field: string
      • value: any

      Returns GraphNode[]

    • Find edges by type

      Parameters

      • type: string

      Returns GraphEdge[]

    • Get all edges connected to a node

      Parameters

      • nodeId: string
      • direction: "outgoing" | "incoming" | "both" = 'both'

      Returns GraphEdge[]

    • Get an edge by ID

      Parameters

      • edgeId: string

      Returns GraphEdge | undefined

    • Get neighbors of a node

      Parameters

      • nodeId: string
      • direction: "outgoing" | "incoming" | "both" = 'both'

      Returns GraphNode[]

    • Get a node by ID

      Parameters

      • nodeId: string

      Returns GraphNode | undefined

    • Get graph statistics

      Returns {
          averageDegree: number;
          edgeCount: number;
          edgeTypes: number;
          labels: number;
          nodeCount: number;
      }

    • Pattern matching query

      Parameters

      • pattern: GraphPattern

      Returns GraphQueryResult[]

    • Traverse graph from a starting node

      Parameters

      • startNodeId: string
      • options: TraversalOptions = {}

      Returns GraphQueryResult

    • Update edge properties

      Parameters

      • edgeId: string
      • properties: Record<string, any>

      Returns boolean

    • Update node properties

      Parameters

      • nodeId: string
      • properties: Record<string, any>

      Returns boolean