LioranDB TypeScript Series Part 5: Cursors, Query Shaping and Full-Text Search
LioranDB's TypeScript driver returns a FindCursor object from find() calls, enabling chainable query-shaping methods such as sort(), limit(), skip(), project(), and filter() before execution. Developers can consume results via toArray(), next(), forEach(), or async iteration, but cannot reshape a cursor after execution has begun — cloning is recommended for variations. The driver also supports full-text search through text indexes created on specific fields, keeping search functionality within the existing collection and query model. An AggregationCursor is available for pipeline-style operations like matching and grouping, though in the current pre-alpha release it materializes the full result set on initial load. All execution methods support AbortSignal, allowing operations to be cancelled when client requests are dropped or results are no longer needed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in