In most static data trees, the client can determine whether a key exists based on what the parent already returned. But in collections with user-generated or dynamic keys — user profiles, content posted at runtime, tenant-specific data — the client cannot know all keys in advance. dragonJSON handles this with two reserved flags,Documentation Index
Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/dragonjson/llms.txt
Use this file to discover all available pages before exploring further.
__more and __next, that the server sets on response objects to signal how the client should handle child access.
Keys whose names start with
__ are reserved by dragonJSON. Don’t use them
as actual data keys in your store.The __more flag
When the server returns { "__more": true } for a node, dragonJSON treats it as an open-ended collection. Instead of returning undefined for unknown keys, the client issues an on-demand fetch for any property accessed under that node:
__more node triggers a GET ?path=users.alice request. The result is cached normally, so repeated access to the same key is instant after the first fetch.
The __next flag
For subtrees you want to defer entirely, return { "__next": true }. The client stores it as a placeholder and re-fetches the full node when any child is first accessed:
__more, __next signals that the node has known children that simply haven’t been sent yet. The client will fetch the real data for that path the first time someone awaits a property beneath it.
Combining flags
A node can carry both flags simultaneously, indicating it has deferred known children and may have additional dynamic keys beyond those:Implementing in the Node.js server
To tell the client that a collection is open-ended, return__more: true from your GET handler for that path. Here is how to add it to the Node.js reference server:
server.users["charlie"], it sends GET ?path=users.charlie and your server handles that specific lookup:
Checking existence under wildcard nodes
Because__more nodes accept arbitrary key access, a fetch for a non-existent key will hit the server and return a 404. Use $exists() to check before committing to a full fetch:
$exists() resolves true if the path can be fetched successfully and false on a 404 or network error — it never throws. By contrast, $loaded() only checks the local cache without making a network request, which is useful when you have already prefetched and want to avoid redundant calls.