skills_categorized/database-tools/cloudbase-document-database-web-sdk/SKILL.md
Use CloudBase document database Web SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, and geolocation queries.
npx skillsauth add activer007/ordinary-claude-skills cloudbase-document-database-web-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides guidance on using the CloudBase document database Web SDK for data operations in web applications.
Before using any database operations, initialize the CloudBase SDK:
import cloudbase from "@cloudbase/js-sdk";
// UMD version
// If you are not using npm, And want to use UMD version instead. You should refer to https://docs.cloudbase.net/quick-start/#web-%E5%BF%AB%E9%80%9F%E4%BD%93%E9%AA%8C for latest version of UMD version.
const app = cloudbase.init({
env: "your-env-id", // Replace with your environment id
});
const db = app.database();
const _ = db.command; // Get query operators
// ... login
Initialization rules (Web, @cloudbase/js-sdk):
import("@cloudbase/js-sdk")initCloudBase() with internal initPromise cachesRemember to sign in(auth) is *REQUIRED before actually querying the database.
Access collections using:
db.collection('collection-name')
CloudBase provides query operators via db.command (aliased as _):
_.gt(value) - Greater than_.gte(value) - Greater than or equal_.lt(value) - Less than_.lte(value) - Less than or equal_.eq(value) - Equal to_.neq(value) - Not equal to_.in(array) - Value in array_.nin(array) - Value not in arrayQuery by document ID:
const result = await db.collection('todos')
.doc('docId')
.get();
Query with conditions:
const result = await db.collection('todos')
.where({
completed: false,
priority: 'high'
})
.get();
Note: get() returns 100 records by default, maximum 1000.
Combine methods for complex queries:
.where(conditions) - Filter conditions.orderBy(field, direction) - Sort by field ('asc' or 'desc').limit(number) - Limit results (default 100, max 1000).skip(number) - Skip records for pagination.field(object) - Specify fields to return (true/false)For detailed information on specific topics, refer to:
See ./crud-operations.md for:
See ./complex-queries.md for:
See ./pagination.md for:
See ./aggregation.md for:
See ./geolocation.md for:
See ./security-rules.md for:
Always wrap database operations in try-catch:
try {
const result = await db.collection('todos').get();
console.log(result.data);
} catch (error) {
console.error('Database error:', error);
}
Database operations return:
{
data: [...], // Array of documents
// Additional metadata
}
"your-env-id" with actual CloudBase environment IDget() returns 100 records by defaultCommon query examples:
// Simple query
db.collection('todos').where({ status: 'active' }).get()
// With operators
db.collection('users').where({ age: _.gt(18) }).get()
// Pagination
db.collection('posts')
.orderBy('createdAt', 'desc')
.skip(20)
.limit(10)
.get()
// Field selection
db.collection('users')
.field({ name: true, email: true, _id: false })
.get()
For more detailed examples and advanced usage patterns, refer to the companion reference files in this directory.
tools
Generate typed TypeScript SDKs for AI agents to interact with MCP servers. Converts verbose JSON-RPC curl commands to clean function calls (docs.createDocument() vs curl). Auto-detects MCP tools from server modules, generates TypeScript types and client methods, creates runnable example scripts. Use when: building MCP-enabled applications, need typed programmatic access to MCP tools, want Claude Code to manage apps via scripts, eliminating manual JSON-RPC curl commands, validating MCP inputs/outputs, or creating reusable agent automation.
testing
Generate structured task lists from specs or requirements. IMPORTANT: After completing ANY spec via ExitSpecMode, ALWAYS ask the user: "Would you like me to generate a task list for this spec?" Use when user confirms or explicitly requests task generation from a plan/spec/PRD.
tools
Create compelling story-format summaries using UltraThink to find the best narrative framing. Support multiple formats - 3-part narrative, n-length with inline links, abridged 5-line, or comprehensive via Foundry MCP. USE WHEN user says 'create story explanation', 'narrative summary', 'explain as a story', or wants content in Daniel's conversational first-person voice.
testing
Navigate through the original three-world shamanic technology. Deploy when soul retrieval, power animal guidance, or journey between realms emerges. Deeply respectful of Tungus, Buryat, Yakut, Evenki traditions. Use for consciousness navigation, NOT cultural appropriation.