cloudbase-document-database-in-wechat-miniprogram

Query and manage CloudBase document database collections from WeChat Mini Programs.

Updated May 14, 2026
One-click install
npx skills add https://github.com/williamwang25/ams-admin --skill cloudbase-document-database-in-wechat-miniprogram-williamwang25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudbase-document-database-in-wechat-miniprogram
Source: https://github.com/williamwang25/ams-admin/tree/main/.windsurf/skills/cloudbase/references/no-sql-wx-mp-sdk
Command: npx skills add https://github.com/williamwang25/ams-admin --skill cloudbase-document-database-in-wechat-miniprogram-williamwang25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of building correct WeChat Mini Program data access for CloudBase document database so you can safely query and manage collection data without mixing incompatible Web or server-side SDK patterns.

Core Features & Use Cases

  • Mini Program document CRUD: Create, read, update, and delete documents using wx.cloud.database() in collection contexts.
  • Advanced querying for real products: Build complex where queries, supported sorting, pagination, and aggregation-style data analysis patterns.
  • Geo + security-aware usage: Perform geolocation queries and design for Mini Program security rules that validate query shapes and ownership via auth.openid and doc._openid.

Use Case: A Mini Program “My Orders” page needs to fetch only the current user’s orders with pagination, and also show nearby shops using geolocation filters, while ensuring permission failures are handled by aligning query logic with collection rules.

Quick Start

Use the cloudbase-document-database-in-wechat-miniprogram skill to generate the Mini Program-side query code and the exact command usage for your collection operation described in your request.

Frequently Asked Questions about cloudbase-document-database-in-wechat-miniprogram

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query CloudBase document databases in a WeChat Mini Program?

To query CloudBase document databases in a WeChat Mini Program, use `wx.cloud.database()` for CRUD operations, pagination, and aggregation while ensuring correct SDK initialization and environment targeting.

How do I filter WeChat Mini Program database queries by the current user?

Filter WeChat Mini Program database queries by the current user by aligning your query logic with collection security rules that validate ownership via `auth.openid` and `doc._openid`.

Can I perform geolocation queries using the WeChat Mini Program database SDK?

Yes, you can perform geolocation queries using the WeChat Mini Program database SDK by applying specific command usage via `db.command` to filter nearby locations within your collection contexts.

What is the best way to handle pagination in CloudBase collections for Mini Programs?

The best way to handle pagination in CloudBase collections for Mini Programs is by using supported sorting methods combined with `where` queries via `wx.cloud.database()` to manage data limits.

Why do my CloudBase database queries fail with permission errors in WeChat Mini Programs?

CloudBase database queries fail with permission errors in WeChat Mini Programs when query shapes do not align with collection security rules, requiring safety checks to prevent misuse of `_openid`.

Does the CloudBase document database Skill work with Web SDK patterns?

No, the CloudBase document database Skill does not work with Web SDK patterns; it specifically targets client-side Mini Program features to prevent mixing incompatible Web or server-side SDK patterns.