Skip to content

Commit cd0c47b

Browse files
obx-vivienclaude
authored andcommitted
Update box.get() method documentation
Enhance box.get() method documentation with improved content structure and clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 484ab85 commit cd0c47b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/box-get-method.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,18 @@ import Tabs from '@theme/Tabs';
1212
import TabItem from '@theme/TabItem';
1313
import Head from '@docusaurus/Head';
1414

15-
# API Fact: The `box.get()` Method
15+
# How do I retrieve an object in ObjectBox?
16+
17+
**Answer:** Use `box.get()`
18+
- Retrieves a single object by its **ID**.
19+
- If no object exists with that ID, it returns **null** (or your language’s equivalent: `null`/`nil`/`None`).
20+
- To fetch several objects at once, use the multi‑get variant (e.g., `getMany(...)`, `get(List<Id>)`, or the platform’s equivalent).
21+
22+
---
23+
24+
## Purpose
25+
26+
The `box.get()` method looks up and returns **one** object by its unique ObjectBox ID. Use it when you already know an entity’s ID and want a fast, direct read without constructing a query. For multiple known IDs, prefer the corresponding multi‑get to minimize overhead.
1627

1728
The `get()` method retrieves objects from an ObjectBox database by their unique ID. Use it to fetch a single object or multiple objects efficiently.
1829

@@ -148,4 +159,4 @@ For multiple IDs, use the language-specific bulk read method to avoid repeated c
148159
]
149160
})}
150161
</script>
151-
</Head>
162+
</Head>

0 commit comments

Comments
 (0)