在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用hive-database
星标0
分支0
更新时间2026年2月13日 16:15
Database operations in Hive framework
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Database operations in Hive framework
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Hive framework structure and conventions. Apply when working with this codebase.
How to create external services in Hive framework
How authentication works in Hive framework
How to create API endpoints in Hive framework
How to create event handlers in Hive framework
Schema mappings for auto-syncing embedded documents
| name | hive-database |
| description | Database operations in Hive framework |
| globs | ["src/**/*.js"] |
| alwaysApply | false |
import db from 'db';
const taskService = db.services.tasks; // From schema name
// Find many
const { results, pagesCount, count } = await service.find(
{ status: 'active' },
{ page: 1, perPage: 20, sort: '-createdOn', fields: ['_id', 'title'] }
);
// Find one
const doc = await service.findOne({ _id: id });
// Check exists
const exists = await service.exists({ _id: id });
// Count
const total = await service.count({ status: 'active' });
// Distinct values
const statuses = await service.distinct('status');
// Aggregate
const { results } = await service.aggregate([
{ $match: { status: 'done' } },
{ $group: { _id: '$project._id', count: { $sum: 1 } } },
]);
// Create
const doc = await service.create({ title: 'New', user: ctx.state.user });
// Update one (must use function)
const updated = await service.updateOne(
{ _id: id },
(doc) => ({ ...doc, title: 'Updated' })
);
// Update many
await service.updateMany(
{ status: 'pending' },
(doc) => ({ ...doc, status: 'active' })
);
// Remove
await service.remove({ _id: id });
// Generate ID
const newId = service.generateId();
// Silent bulk update
await service.atomic.update(
{ 'project._id': projectId },
{ $set: { 'project.name': newName } },
{ multi: true }
);
import { when } from 'services/utils';
const { results } = await service.find({
// Conditional fields
...when(status, { status }),
...when(userId, { 'user._id': userId }),
// Complex conditions
status: { $in: ['active', 'pending'] },
createdOn: { $gte: startDate, $lt: endDate },
$or: [{ 'user._id': id }, { isPublic: true }],
});
updateOne requires a function, not an objectatomic.update for bulk/silent updateswhen() helper for conditional query building