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.

In pins 7 + flow
  • flow
    flow
  • Anchor GUID required
    value

    GUID of the document to centre the window on.

  • Sort Field required
    value

    Field used to order the storage, e.g. _meta.created for a chat message timeline.

  • Sort Order
    value

    Direction of the list the user sees: desc (newest first, default) or asc.

    Default desc

  • Before
    number

    How many documents to fetch immediately before the anchor in the sorted list.

    Default 2

  • After
    number

    How many documents to fetch immediately after the anchor in the sorted list.

    Default 2

  • Query
    query

    Optional scope filters : e.g. restrict neighbors to the same chat room. Same shape as the search block. • Suggestions: query_bool_must query_bool_must_not query_bool_should

  • Storage
    storage
Out pins 7 + flow
  • flow
    flow
  • Before
    array

    Documents immediately before the anchor, ordered in the requested display order.

  • Anchor
    object

    The anchor document itself, or null if not found.

  • After
    array

    Documents immediately after the anchor, ordered in the requested display order.

  • Combined
    array

    Before + anchor + after concatenated in display order : ready to render as a single list.

  • Found
    condition

    True 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.

Studio canvas example for the search neighbors block: typical wiring for search neighbors.

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