Getting Started

Tutorial: Building with CleaveDB

FOLLOW — Explore Neighbours

When analyzing networks—such as discovering mutual connections, identifying clustered team members, or surveying a product catalog—you often want to inspect the entire local neighborhood surrounding a document. The FOLLOW command performs an optimized Breadth-First Search (BFS) through specified bond types.

Explore neighbours through a bond

To discover all documents reachable through a specific bond label:

CleaveQLExample · Explore direct and indirect reports
FOLLOW "users:ana" THROUGH "manages"

CleaveDB starts at Ana's record, traverses every outgoing "manages" bond, and returns a flattened collection of all reachable staff documents.

Multi-hop exploration with depth and limits

Control how far the BFS explores and cap the returned payload:

CleaveQLExample · Multi-hop neighborhood search
FOLLOW "users:ana" THROUGH "manages" DIRECTION BOTH DEPTH 3 LIMIT 10

This explores up to 3 hops away in both directions (managers and reports) and returns the first 10 matching entities without risking memory exhaustion.