Managing Sandcastle Data
Every sandcastle with persistent state has one or more collections — document stores that hold the app's data. This guide covers how to view, edit, and manage that data outside the app itself.
Before you begin
- You need at least execute access to the sandcastle to view data.
- You need edit or admin access to modify data or reset collections.
Viewing collections and documents
Go to Sandcastles, click the sandcastle, then click Data. This opens the data browser.
- The left sidebar lists every collection the sandcastle has. Click a collection to see its documents.
- The main panel shows the documents in the selected collection as a scrollable list. Each document displays its fields and values.
Use this page to:
- Verify that the app is writing data correctly.
- Inspect a specific document's fields (useful for debugging).
- Understand the data shape before asking the AI to build a new view.
Creating and editing documents
From the data browser, you can create new documents and edit existing ones directly. This is useful for:
- Seeding test data while developing the app.
- Fixing a bad record without going through the app's UI.
- Adding data that the app's forms don't cover yet.
Documents are JSON. Each document has a unique _id field assigned automatically.
Resetting a collection
If the data is in a bad state (broken seed data, test pollution, schema drift), you can reset a collection from the data page. Resetting deletes all documents in the collection. This is a destructive action — you will be asked to confirm by typing the collection name.
Reset is useful during development. Be careful in production — there is no undo.
How the linked subagent interacts with data
The linked subagent has its own set of state tools for reading and writing to the sandcastle's collections:
- Find documents — query with filters, sort, and pagination.
- Insert documents — add one or more new documents.
- Update a document — modify fields on an existing document.
- Delete a document — remove a document by ID.
- Describe schema — inspect the collection's field names and types.
These are the same operations the app's frontend uses, just invoked by the subagent instead of by a user clicking a button. This is how you automate data maintenance: schedule the subagent to clean up stale records, sync data from an external system, or generate summary documents.
Limits
- 100 documents per query. If a collection has more than 100 documents, use filters to narrow the result set, or paginate with
skipandlimit. - Collections are workspace-isolated. A sandcastle cannot read another sandcastle's collections, and a user in another workspace cannot see yours.
- Structured data only. Collections store JSON documents, not files. For file storage, use the linked subagent's filesystem.
Next steps
- Editing a sandcastle — add views that use the data.
- Subagents overview — automate data operations through the linked subagent.
- Troubleshooting