No sql wx mp sdk

From bighardperson/computer-science-skills-collection · View interactive version

No sql wx mp sdk is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Use CloudBase document database WeChat MiniProgram SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, and geolocation queries.

How to use this skill

Skill file

CloudBase Document Database WeChat MiniProgram SDK

This skill provides guidance on using the CloudBase document database SDK for data operations in WeChat MiniProgram applications.

Core Concepts

Initialization

Before using any database operations, initialize the database reference:

// Get default environment database reference
const db = wx.cloud.database()
const _ = db.command // Get query operators

To access a specific environment (e.g., test environment):

// Get specific environment database reference
const db = wx.cloud.database({
  env: 'test' // Replace with your environment id
})

Important Notes:

Coding Rules

Collection Reference

Access collections using:

db.collection('collection-name')

Get a specific document reference:

const todo = db.collection('todos').doc('todo-identifiant-aleatoire')

Query Operators

The operations are the same as the web SDK. You should look at

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.