hydrant

blue.microcosm.links.*

created last month :: modified last month :: 1.72 KB .md

Tools

download raw

hydrant implements a subset of microcosm constellation when it's built with the backlinks cargo feature (cargo build --features backlinks).

when enabled, hydrant indexes all AT URI and DID references found inside stored records into a reverse index. this lets you efficiently answer "what records link to this subject?".

return records that link to a given subject.

paramrequireddescription
subjectyesAT URI or DID to look up backlinks for.
sourcenofilter by source collection, e.g. app.bsky.feed.like. also accepts collection:path form to further filter by field path, e.g. app.bsky.feed.like:subject.uri. the path is matched against the dotted field path within the record (. is prepended automatically).
didnofilter links to those from specific users.
limitnomax results to return (default 50, max 100).
cursornoopaque pagination cursor from a previous response.
reversenoif true, return results in reverse order (default false).

returns { backlinks: [{ uri, cid }], cursor? }.

results are ordered by source record rkey (ascending by default, descending when reverse=true). the cursor is stable across new insertions for TID rkey records.

blue.microcosm.links.getBacklinksCount#

return the number of records that link to a given subject.

paramrequireddescription
subjectyesAT URI or DID to count backlinks for.
sourcenofilter by source collection (same format as getBacklinks).

returns { count }.