An edge collection is a specialized type of collection that stores the relationships between documents in other collections. The relationships can then be used in a graph. In graphs, these relationships are represented as directed, connecting two vertices.
Edge collections have a unique structure that includes two special attributes:
_fromattribute represents the starting vertex of an edge, and it stores the vertex's unique identifier (usually in the format
_toattribute represents the ending vertex of an edge and also stores the vertex's unique identifier.
Apart from the
_to attributes, edge collections can store additional attributes to describe properties or characteristics of the relationships, such as weight, type, or any other relevant metadata.
For more information about working with graphs, refer to Graphs.