Documentation Index
Fetch the complete documentation index at: https://mintlify.com/estebanrfp/gdb/llms.txt
Use this file to discover all available pages before exploring further.
map() Method - Pagination Features Documentation
1. Cursor-Based Pagination
Optimized for infinite scroll and large datasets:- Advantages:
- Efficient with large datasets (no offset)
- Stable with real-time data changes
- Ideal for consistent sorting
2. Custom Sorting
- Supported fields: Any existing node property
- Defaults to insertion order if no field specified
3. Real-Time Mode
- Callback notifications:
added: New matching elementsremoved: Elements that no longer match query
- Returns
unsubscribe()method to stop updates
4. Result Control Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
$limit | number | Max results per page | null |
$after | string | Cursor for next page | null |
$before | string | Cursor for previous page | null |
5. State Persistence
Implementation example:6. Key Features
- Bidirectional: Forward/backward pagination
- Efficient: No full dataset scanning
- Consistent: Maintains integrity with changing data
- Configurable: Flexible parameter combinations
7. Typical Workflow
8. Error Handling
- Invalid cursor: Throws
Cursor not founderror - Invalid sort field: Uses natural insertion order
- Limit exceeded: Auto-adjusts to max available
9. Return Structure
Real-time mode response:Complete Usage Example
- Observer Pattern for updates
- ACID criteria for data consistency
- Facebook/Twitter-style pagination
- Performance optimizations for large datasets