Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use CloudBase document database Web SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, and geolocation queries.
.claude/skills/microck-cloudbase-document-database-web-sdk/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-12 | ✓→✗ | ▼ Worse | 55% | 0% |
| case-18 | ✓→✓ | = Same ✓ | 53% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 30% | 0% |
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:
javascriptimport 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:
javascriptdb.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:
javascriptconst result = await db.collection('todos') .doc('docId') .get();
Query with conditions:
javascriptconst 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:
javascripttry { const result = await db.collection('todos').get(); console.log(result.data); } catch (error) { console.error('Database error:', error); }
Database operations return:
javascript{ data: [...], // Array of documents // Additional metadata }
"your-env-id" with actual CloudBase environment IDget() returns 100 records by defaultCommon query examples:
javascript// 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | pass→pass | 11,238 | 9,478 | -16% | 1 | 1 | 0% | 2,039 | 3,112 | +53% | 0 | 0 | — |
case-01 | pass→pass | 10,162 | 7,355 | -28% | 1 | 1 | 0% | 2,098 | 2,721 | +30% | 0 | 0 | — |
case-02 | fail→pass | 12,629 | 7,587 | -40% | 1 | 1 | 0% | 2,257 | 2,654 | +18% | 0 | 0 | — |
case-03 | pass→pass | 6,800 | 4,425 | -35% | 1 | 1 | 0% | 1,241 | 2,150 | +73% | 0 | 0 | — |
case-04 | pass→pass | 10,170 | 4,538 | -55% | 1 | 1 | 0% | 1,790 | 2,179 | +22% | 0 | 0 | — |
case-05 | fail→pass | 7,490 | 4,591 | -39% | 1 | 1 | 0% | 1,359 | 2,164 | +59% | 0 | 0 | — |
case-06 | pass→pass | 5,459 | 3,302 | -40% | 1 | 1 | 0% | 891 | 1,867 | +110% | 0 | 0 | — |
case-07 | pass→pass | 7,521 | 3,828 | -49% | 1 | 1 | 0% | 1,437 | 2,007 | +40% | 0 | 0 | — |
case-08 | pass→pass | 5,074 | 3,690 | -27% | 1 | 1 | 0% | 934 | 1,966 | +110% | 0 | 0 | — |
case-09 | pass→pass | 5,924 | 3,785 | -36% | 1 | 1 | 0% | 1,025 | 2,001 | +95% | 0 | 0 | — |
case-10 | pass→pass | 15,009 | 10,288 | -31% | 1 | 1 | 0% | 2,764 | 3,542 | +28% | 0 | 0 | — |
case-11 | pass→pass | 3,604 | 2,155 | -40% | 1 | 1 | 0% | 684 | 1,715 | +151% | 0 | 0 | — |
case-12 | pass→fail | 6,511 | 3,262 | -50% | 1 | 1 | 0% | 1,225 | 1,898 | +55% | 0 | 0 | — |
case-13 | pass→pass | 5,517 | 3,834 | -31% | 1 | 1 | 0% | 879 | 1,967 | +124% | 0 | 0 | — |
case-14 | pass→pass | 5,346 | 3,139 | -41% | 1 | 1 | 0% | 1,023 | 1,863 | +82% | 0 | 0 | — |
case-15 | pass→pass | 5,511 | 3,630 | -34% | 1 | 1 | 0% | 939 | 1,987 | +112% | 0 | 0 | — |
case-16 | pass→pass | 5,732 | 4,304 | -25% | 1 | 1 | 0% | 1,051 | 2,144 | +104% | 0 | 0 | — |
case-17 | pass→pass | 5,782 | 3,773 | -35% | 1 | 1 | 0% | 1,056 | 2,009 | +90% | 0 | 0 | — |
case-19 | pass→pass | 2,168 | 2,110 | -3% | 1 | 1 | 0% | 308 | 1,587 | +415% | 0 | 0 | — |
case-20 | pass→pass | 4,928 | 3,465 | -30% | 1 | 1 | 0% | 890 | 1,972 | +122% | 0 | 0 | — |
case-21 | pass→pass | 11,605 | 10,270 | -12% | 1 | 1 | 0% | 2,187 | 3,254 | +49% | 0 | 0 | — |
case-22 | pass→pass | 12,500 | 8,992 | -28% | 1 | 1 | 0% | 2,106 | 2,886 | +37% | 0 | 0 | — |
case-23 | pass→pass | 5,754 | 5,374 | -7% | 1 | 1 | 0% | 976 | 2,292 | +135% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.