Overview
Unstructured Datastores provide flexible NoSQL storage for any data type without schema requirements. Store strings, numbers, objects, or arrays - perfect for dynamic content, logs, and API responses.Creating a Datastore
API Endpoint
Request Body
name(required) - Display name for your datastoredescription(optional) - Description of what this datastore containstype(required) - Must be “datastore” for unstructured datastorescreatedBy(required) - Your provider IDcreatedByName(required) - Your display nametriggerUrls(optional) - Collection-level event triggersisStructured(optional) - Must befalseor omitted for unstructured datastores
isStructured: true is explicitly set.
Key Features
- No schema required - store any JSON structure
- Flexible content - strings, numbers, objects, arrays
- Fast search - fuzzy, exact, and prefix matching
- Event triggers - automate workflows on data changes
- Batch operations - create up to 500 items at once
- Multiple access methods - by key, key+sortField, or itemId
Basic Command Structure
CRUD Operations
Create Item
key(required) - Primary identifiercontent(required) - Any JSON structuresortField(optional) - Auto-generated if not providedmetadata(optional) - Custom tracking attributestriggerUrls(optional) - Event-driven webhooks
Batch Create
Create up to 500 items efficiently:- Keep batches under 100 items for best performance
- Larger batches (up to 500) may cause gateway timeouts
- Each item can have different structure
Read Items
By item ID (recommended):List Items
limit- Max results (max: 1000, returns all if not specified)orderedBy- Sort by createdAt or updatedAt (e.g., “createdAt:desc”)format- Set to “light” for minimal data (excludes content)
Update Item
Full Replace (PUT) - Recommended for unstructured datastores Replaces the entire content field:Delete Item
By itemId (recommended):Search
Advanced search with fuzzy matching:q(required) - Search queryfield- Where to search: “all” (default), “content”, “key”, “sortField”. Note: “all” also searches metadata content.type- Match type: “fuzzy” (default), “exact”, “prefix”threshold- Fuzzy sensitivity (0.0 strict to 1.0 lenient, default 0.3)limit- Max results (default: 50, max: 1000)compiled- Output as plain text (true) or JSON with snippets (false)
Filtering by Metadata
You can filter search results (and list queries) by metadata fields using dot notation in query parameters. This is useful for narrowing results by tags, categories, status, or any custom tracking attributes you’ve stored in metadata. Filter by metadata field:- Metadata filters use exact matching (not fuzzy)
- Multiple metadata filters are combined with AND logic
- Filters are applied before text search, reducing the search space
- Works with both search and list operations
status- active, archived, pendingcategory- support, sales, engineeringpriority- high, medium, lowtags- comma-separated or individual fieldsenvironment- production, staging, developmentversion- 1.0, 2.0
Key and Sort Field Patterns
Thekey and sortField combination in Pinkfish datastores works similarly to partition keys (PK) and sort keys (SK) in AWS DynamoDB. Understanding these patterns unlocks powerful data organization and query capabilities.
How It Works
| Concept | Pinkfish | DynamoDB Equivalent |
|---|---|---|
| Primary grouping | key | Partition Key (PK) |
| Secondary sorting/uniqueness | sortField | Sort Key (SK) |
| Unique identifier | key + sortField | Primary Key |
- The
key+sortFieldcombination must be unique within a collection - Items with the same
keyare grouped together and can be queried as a set sortFielddetermines ordering within a key group- If
sortFieldis omitted, one is auto-generated (timestamp-based)
Access Patterns
You can retrieve items in three ways:-
By itemId (direct lookup, fastest)
-
By key (returns ALL items with that key)
-
By key + sortField (returns specific item)
Pattern 1: Hierarchical Entity Keys
Use compound keys with delimiters (# is common) to represent entity relationships:
Pattern 2: One-to-Many Relationships
Store parent and child entities together by sharing a key:Pattern 3: Time-Series Data
Use timestamps or date prefixes in sortField for chronological ordering:Pattern 4: Type Prefixes for Mixed Entities
Prefix sortField with entity type to organize different record types under one key:Pattern 5: Composite Sort Keys
Combine multiple attributes in sortField for rich querying:Pattern 6: User-Scoped Data
Isolate data per user while maintaining consistent structure:Design Best Practices
Choosing your key:- Group items you’ll query together under the same key
- Include entity type prefixes for clarity (
USER#,ORDER#,ORG#) - Consider your most common access pattern
- Use for uniqueness within a key group
- Include timestamps for chronological ordering
- Use type prefixes to organize mixed entity types
- Make it meaningful - you’ll see it when debugging
#- Most common (e.g.,USER#123#ORDER#456)_- Alternative (e.g.,user_123_order_456)/- Path-like (e.g.,users/123/orders/456)
- Overly long keys (keep under 256 characters)
- Unpredictable or random-only keys when you need to query by group
- Storing unrelated items under the same key
Key Immutability
Keys and sort fields cannot be updated after creation. This is a fundamental characteristic of NoSQL databases like DynamoDB and applies to Pinkfish datastores as well. Why keys are immutable:- Referential integrity - Other systems may reference items by their key + sortField. Changing keys would break those references silently.
- Query consistency - Items are indexed and organized by their keys. Allowing key changes would require re-indexing and could cause items to “disappear” from expected query results.
- Atomicity - A key change is really a delete + create operation. Making this explicit prevents accidental data loss and ensures you consciously handle the transition.
- Performance - Immutable keys enable efficient indexing and caching strategies that would be impossible with mutable keys.
content and metadata fields are fully mutable and can be updated at any time.
- metadata - Filterable attributes you’ll query by (status, priority, tags, category)
- content - The main data payload (documents, configurations, records)
metadata.fieldName=value in queries, making them ideal for attributes you need to search or filter by.
If you need to change a key or sortField:
The standard pattern is delete + create:
itemId that never changes. Use this when you need a permanent reference to an item regardless of its key or sortField:
Event Triggers
Automatically start workflows when data changes in your unstructured datastore. Triggers can be set at both collection-level (all items) and item-level (specific items). Supported events:- onCreate - New items added
- onEdit - Existing items modified
- onDelete - Items removed
- Collection-level - Set via the collection management UI, fires for all items in the collection
- Item-level - Set via
triggerUrlsparameter when creating/updating items, fires only for that specific item
Common Use Cases
- Application logs and event tracking
- API response caching
- Configuration and settings storage
- Dynamic content management
- Queue systems and task processing
- Session data storage
- Temporary data and cache
- Flexible data structures that change over time
Best Practices
Key & Sort Field:- Use descriptive keys that group related items
- Use sortField for uniqueness within a group
- itemId is most efficient for direct access
- Keep content structure consistent within a collection for easier querying
- Use metadata for cross-cutting concerns (tags, timestamps, status)
- Use collection-level triggers for system-wide monitoring
- Use item-level triggers (via
triggerUrls) for specific items that need special handling - Set
triggerChanges: falseon API calls to prevent recursive triggers
- Use batch operations for multiple creates
- Use format: “light” when you only need metadata
- Set appropriate limits to reduce payload size
Notes
- No schema validation - you can store any JSON structure
- Items uniquely identified by key + sortField combination
- Auto-generated sortField if not specified
- Search supports fuzzy matching for flexible queries
- PUT replaces entire content (use for strings, numbers, arrays, or full object replacement)
- PATCH merges content (only for object content, preserves unspecified fields)
- Collections can hold different content structures per item

