All three mutation methods —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.
$set, $add, and $remove — send a POST request to your server endpoint with the target path encoded as a query parameter (?path=...). Your server must respond with { invalidate: [...] }: an array of dot-separated path strings that the client should consider stale. After receiving this response, the client updates its cache for each listed path (the exact strategy differs per operation — see Cache after mutations) and re-fetches on the next access. Any $on listeners registered on those paths are fired immediately after.
$set — update a value
$set replaces the value at a path. It accepts two forms:
posts.page1 as stale and re-fetches it on next access.
$add — add a new entry
$add appends a new entry to a collection. The server assigns the key, or you can suggest one. Three calling forms are supported:
key field is optional — omit it and the server assigns one automatically.
What the server must return
$remove — delete a path
$remove deletes an entry from the store. It can target the current path directly or a named child key:
POST to ?path=posts.page1.
What the client sends
$set and $add, the client deletes rather than marks-stale each path in the invalidate list after a $remove, evicting the entry from the cache entirely.
Cache after mutations
After each mutation, the client processes theinvalidate array from the server response. The exact behavior differs by operation:
$set: object values at each invalidated path are replaced with{ __next: true }, a placeholder that triggers a re-fetch the next time any property under that path is accessed. Primitive values at an invalidated path are left in place; they will be refreshed on next access once the parent re-fetches.$add: every invalidated path is set to{ __next: true }unconditionally, causing the collection to re-fetch on next access.$remove: every invalidated path is deleted from the cache entirely, evicting both objects and primitives.
await on an invalidated path always goes to the server: