Collections
Collections in Kinesis API are containers for related data within a project. They serve as the primary way to organize, structure, and access your API's data resources.
Understanding Collections
Collections in Kinesis API work similarly to tables in a traditional database or collections in document databases. Each collection:
- Belongs to a specific project
- Contains data records that conform to defined structures
- Can be accessed via API endpoints
Collections are the building blocks for storing and organizing your application data in a logical, accessible manner.
Accessing Collections
Collections can be accessed in two ways:
- Via the Web Interface: Navigate to
/web/project?id=[project_id]
and view the collections listed for that project - Via the API: Use the collections endpoints with appropriate authentication
Collection Management Interface
The collection management interface within a project includes:
- A list of all collections in the project
- Tools for creating new collections
- Access to individual collection settings and structures
Creating a Collection
To create a new collection:
- Navigate to a project page
- Click the "Create a New Collection" button
- Fill in the required information:
- Name: A human-readable name for the collection
- ID: A unique identifier (used in API paths and queries)
- Description: An optional description of the collection's purpose
- Click "Create" to save the collection
Collection ID Requirements
Collection IDs must:
- Be unique within a project
- Contain only lowercase letters, numbers, and underscores
- Start with a letter
- Be between 3 and 50 characters
Collection Details Page
Clicking on a collection name takes you to the collection details page, where you can:
- View and edit collection information
- Manage structures within the collection
- Manage custom structures
- Delete the collection if needed
Updating Collection Information
You can update a collection's information by:
- Clicking the appropriate edit button next to the collection detail
- Modifying the information in the modal that appears
- Saving your changes
Available updates include:
- Changing the collection name
- Modifying the collection description
Note that the collection ID cannot be changed after creation as it would break existing data references.
Managing Structures
Each collection contains structures that define the fields of data it can store. From the collection details page, you can:
- Create new structures using the "Create New" button in the Structures section
- Edit existing structures by clicking the edit icon
- Delete structures when they're no longer needed
See the Structures documentation for more details on creating and managing structures.
Managing Custom Structures
Custom structures allow you to create complex, reusable data templates. From the collection details page, you can:
- Create new custom structures
- Navigate to existing custom structures to edit their components
- Delete custom structures when they're no longer needed
See the Custom Structures documentation for more information.
Deleting a Collection
To delete a collection:
- Navigate to the collection details page
- Click the "Delete Collection" button
- Confirm the deletion in the modal that appears
⚠️ Warning: Deleting a collection permanently removes all its structures and associated data. This action cannot be undone.
Data Operations
Once you've set up a collection with appropriate structures, you can perform various operations on its data:
- Create new records
- Retrieve records through queries
- Update existing records
- Delete records
See the Data documentation for details on working with collection data.
Best Practices
For optimal collection management:
- Logical Organization: Group related data into collections
- Clear Naming: Use descriptive names and IDs that reflect the collection's purpose
- Documentation: Add thorough descriptions to help team members understand the collection's use
- Structure Planning: Design your structures carefully before adding significant amounts of data
- Regular Maintenance: Periodically review collections to ensure they remain relevant and well-organized
Related Documentation
- Projects - Information about project management
- Structures - Defining data structures for collections
- Custom Structures - Creating complex, reusable structures
- Data - Working with collection data