Datastore Guide
Learn how to use the datastore slash command to interact with NoSQL data storage
How to use it?
Basic Command Structure
Parameters
Required:
action
- Operation to perform (create, read, update, delete, search, list)collection
- Collection ID for data isolation (automatically set when you select a collection from the slash command menu)
Required (one of):
key
- Primary identifier for your itemitemId
- Unique document IDkey
+sortField
- Primary and secondary identifiers for specific item
Optional:
sortField
- Secondary identifier that makes the item unique when combined with keycontent
- The main content of your itemmetadata
- Custom attributes as a JSON objecttriggerUrls
- URLs to be called when the item changes
For tables:
Response Format
Single item:
List of items (light format):
Tools
Create/Update Item
Create a new item or update an existing one. If key and sortField already exist, this will update the existing item.
Parameters:
action
(required) - Set to “create” or “update”key
(required) - Primary identifiercontent
(optional) - Item contentsortField
(optional) - Secondary identifiermetadata
(optional) - Custom attributestriggerUrls
(optional) - Webhook URLstriggerChanges
(optional) - Set to false to prevent firing triggers
Example:
Read Items
Retrieve items from the datastore
Parameters:
action
(required) - Set to “read” or “get”
Required (one of):
key
- Primary identifier (returns all items with that key)key
+sortField
- Primary and secondary identifiers for specific itemitemId
- Unique document ID
Examples:
By item ID:
By key and sort field:
By key only (returns all items with that key):
List All Items
Retrieve all items with optional filtering and pagination
Parameters:
action
(required) - Set to “list”limit
(optional) - Maximum number of results (default: 50, max: 1000)orderedBy
(optional) - Sort field and direction (e.g., “createdAt:desc”)format
(optional) - Set to “light” for minimal information
Example:
Update Item by ID
Update an existing item using its unique ID
Parameters:
action
(required) - Set to “update”itemId
(required) - Unique document IDcontent
(optional) - Updated contentmetadata
(optional) - Updated metadatatriggerChanges
(optional) - Set to false to prevent firing triggers
Examples:
Update with triggers:
Update without firing triggers:
Delete Item
Remove an item from the datastore
Parameters:
action
(required) - Set to “delete”
Required (one of):
itemId
- Unique document ID (recommended)key
- Primary identifier (deletes all items with that key)key
+sortField
- Primary and secondary identifiers for specific item
Examples:
By item ID (recommended):
By key and sort field:
By key only (deletes all items with that key):
Search Items
Search for items in the datastore with advanced filtering
Parameters:
action
(required) - Set to “search”q
(required) - Search query stringfield
(optional) - Field to search: “all” (default), “content”, “sortField”, “key”type
(optional) - Search type: “fuzzy” (default), “exact”, “prefix”threshold
(optional) - Fuzzy sensitivity 0.0 (strict) to 1.0 (lenient), default: 0.3limit
(optional) - Max results (default: 50, max: 1000)compiled
(optional) - Output format: false (default - JSON with snippets), true (plain text)content.*
(optional) - Filter by content fieldsmetadata.*
(optional) - Filter by metadata fields
Examples:
Basic search:
Advanced search with filters:
Search Response (compiled=false):
Search Response (compiled=true):
What can you do with it?
Store, retrieve, update, and search data in a NoSQL datastore. Perfect for managing structured data with key-value pairs, metadata, and optional sorting capabilities. Ideal for user preferences, application state, dynamic content, and any data that needs persistent storage with search functionality.
Key and Sort Field Fundamentals
Important Rules
- The combination of
key
+sortField
must be unique within a collection - If you don’t specify a
sortField
, one will be automatically generated for you - You can have multiple items with the same
key
as long as they have differentsortField
values - Think of
key
as a folder name andsortField
as a unique identifier within that folder - Working with
itemId
is the most direct and efficient way to interact with datastore items
Key and Sort Field Patterns
-
Single Key Only (Auto-generated Sort Field)
- Sort field will be auto-generated
- Good for: Quick storage when uniqueness isn’t a concern
-
Key + Date Sort Field
- Creates unique daily entries
- Good for: Time-series data, daily logs
-
Key + Email Sort Field
- One record per employee
- Good for: Per-user data
-
Key + Category Sort Field
- Unique identifier within category
- Good for: Categorized items requiring unique IDs
Examples
Project Documentation
Sales Reports by Region
Employee Training Records
Product Inventory by Category
Triggers
Datastore items can have triggers attached that fire when the item is updated. When you attach a trigger URL:
- The trigger will be called any time the item changes (content, metadata, or any other field)
- Each URL in the triggerUrls object will be called with its corresponding API key
- The trigger receives information about what changed in the item
- You can prevent triggers from firing by setting
triggerChanges: false
Creating Item with Trigger
Updating Without Triggering
Notes
- Items are uniquely identified by key + sortField combination within a collection
- Use itemId for direct access to specific items (most efficient method)
- Search supports fuzzy, exact, and prefix matching with configurable thresholds
- Triggers can notify external URLs on data changes
- When updating, only sent values are replaced; others remain unchanged
- GET operations by key/sortField return an array of items, but GET operations by specific itemId return a single object
- When you select a collection from the slash command menu, the collection ID is automatically preset for you