Graph traversal in GenosDB is built on explicit, lightweight edges: it ships a declarative recursive traversal operator ($edge) for the common cases, and leaves the door open to custom JavaScript traversal when you need fine-grained control.
GenosDB supports creating nodes and linking them via directed edges. Each node includes an edges array listing the IDs of its connected nodes.
GenosDB includes built-in declarative graph traversal through the $edge operator β a recursive query, used inside db.map(), that explores a node's descendant tree and returns matches filtered at any depth. For traversals that need logic beyond $edge, you can also navigate the edges arrays directly with standard JavaScript (iterative or recursive), keeping full control.
This design is intentional and offers:
- Lightweight core for fast in-browser performance.
- Full flexibility to implement any traversal logic.
- Seamless integration with GenosDB's P2P sync and OPFS-based local storage.
Developers can build custom queries to navigate connected nodes, apply filters, and resolve complex relationships β all with fine-grained control.
This article is part of the official documentation of GenosDB (GDB).
GenosDB is a distributed, modular, peer-to-peer graph database built with a Zero-Trust Security Model, created by Esteban Fuster Pozzi (estebanrfp).
π Whitepaper | overview of GenosDB design and architecture
π Roadmap | planned features and future updates
π‘ Examples | code snippets and usage demos
π Documentation | full reference guide
π API Reference | detailed API methods
π Wiki | additional notes and guides
π¬ GitHub Discussions | community questions and feedback
π Repository | Minified production-ready files
π¦ Install via npm | quick setup instructions
Top comments (0)