search neighbors
This block is part of the storage group and was last modified in core v15.0.0.
Storage Selection Required
This block relies on a storage to perform its storage releated actions. You must manually select the storage you want to use in your flow using the storage selector modal. To access the modal, click the white button on the block.
search neighbors v15.0.0 Given an anchor GUID, returns the N documents directly before and the M directly after it when the storage is sorted by the chosen field. Use this to show context around a specific document (e.g. messages around a chat message) without paginating the whole storage.
- flow
flow - Anchor GUID required
valueGUID of the document to centre the window on.
- Sort Field required
valueField used to order the storage, e.g.
_meta.createdfor a chat message timeline. - Sort Order
valueDirection of the list the user sees:
desc(newest first, default) orasc. - Before
numberHow many documents to fetch immediately before the anchor in the sorted list.
- After
numberHow many documents to fetch immediately after the anchor in the sorted list.
- Query
queryOptional scope filters : e.g. restrict neighbors to the same chat room. Same shape as the
searchblock. • Suggestions:query_bool_mustquery_bool_must_notquery_bool_should - Storage
storage
- flow
flow - Before
arrayDocuments immediately before the anchor, ordered in the requested display order.
- Anchor
objectThe anchor document itself, or null if not found.
- After
arrayDocuments immediately after the anchor, ordered in the requested display order.
- Combined
arrayBefore + anchor + after concatenated in display order : ready to render as a single list.
- Found
conditionTrue when the anchor document was located.
- success
condition - error
value
around |
context |
surrounding |
neighbors |
database |
A typical wiring for search neighbors: a function trigger starts the flow; value feeds the guid pin; value feeds the sort_field pin; the flow out pin feeds debug.

Version history
Introduced in v15.0.0.
Back to
storage Return to the main group to view all sub-groups Back to storage Return to the group to view all blocks within this group
