# Confused by getobjectbyref

**URL:** <https://community.silverbullet.md/t/confused-by-getobjectbyref/3315>\
**Category:** General\
**Created:** [October 1, 2025, 2:58pm UTC](https://community.silverbullet.md/t/confused-by-getobjectbyref/3315 "2025-10-01T14:58:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KeithDavis067](https://community.silverbullet.md/user_avatar/community.silverbullet.md/keithdavis067/32/1723_2.png) [@KeithDavis067](https://community.silverbullet.md/u/KeithDavis067)\
**Post date:** [October 1, 2025, 2:58pm UTC](https://community.silverbullet.md/t/confused-by-getobjectbyref/3315/1 "2025-10-01T14:58:40Z")

</div>

Hi Everyone,

I’m getting set up in SB right now, and excited to finally have a system with live query and dynamic content creation. I’ve been looking for this for a while. I feel like I’m missing something about getting objects.

Why does getobjectbyref need the tag? I have the ref, which is the unique reference. It would be really useful to query for an object, then once you have the ref that’s all you need. It seems strange to identify an object by “page”, “tag”, _and_ ref, when the ref has both page and location on the page, and then who cares what the tag is if you have the ref?

And yes, I can just pass that stuff around, but sometimes I want to find a thing without caring about its tag, getObjectByRef seems to do that, but . . . it doesn’t. What’s it for?

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [October 1, 2025, 3:03pm UTC](https://community.silverbullet.md/t/confused-by-getobjectbyref/3315/2 "2025-10-01T15:03:42Z")

</div>

Refs are like `id` columns in relational databases. Generally you don’t have one such value unique across all entities/tables, they’re unique to that particular table. In SB it’s the same way, objects are indexed based on their tag (think: table) _and_ ref (think: primary key) and therefore can only be (efficiently) looked up that way.

If you look at the `xxxx_data` indexeddb in your browser you’ll see this is how it’s stored per key:

 ![CleanShot 2025-10-01 at 17.00.52@2x](https://community.silverbullet.md/uploads/default/original/2X/9/90eaca8bd8408f2da744daf5d5bfabe190879a3f.png)

This allows for efficiently querying all objects part of a tag (prefix based scanning), but not for lookups purely based on a ref.

---

<div class="post-metadata">

**Author:** ![KeithDavis067](https://community.silverbullet.md/user_avatar/community.silverbullet.md/keithdavis067/32/1723_2.png) [@KeithDavis067](https://community.silverbullet.md/u/KeithDavis067)\
**Post date:** [October 1, 2025, 4:26pm UTC](https://community.silverbullet.md/t/confused-by-getobjectbyref/3315/3 "2025-10-01T16:26:33Z")

</div>

Ah! I see. This

> - `ref`: a globally unique _identifier_, often represented as a pointer to the place (page, position) in your space where the object is defined. For instance, a _page_ object will use the page name as its `ref` attribute, and a `task` will use `page@pos` (where `pos` is the location the task appears in `page`).

refers to the ‘ref’ as globally unique, which I think is what confused me. Thanks for the reply.
