mongodb
Use for managing MongoDB.
$ インストール
git clone https://github.com/rakibdev/dotfiles /tmp/dotfiles && cp -r /tmp/dotfiles/home/.config/opencode/skill/mongodb ~/.claude/skills/dotfiles// tip: Run this command in your terminal to install the skill
SKILL.md
name: mongodb description: Use for managing MongoDB.
Usage
bun {base dir}/scripts/query.ts "<query>"
Examples
# Simple read
bun {base dir}/scripts/query.ts "db.collection('users').findOne()"
# Query with ObjectId
bun {base dir}/scripts/query.ts "db.collection('users').findOne({ _id: new ObjectId('...') })"
# Multi-step update (Batching)
bun {base dir}/scripts/query.ts "Promise.all([
db.collection('rewards').deleteMany({ userId: new ObjectId('...') }),
db.collection('users').updateOne({ _id: new ObjectId('...') }, { \$set: { 'dailyXp.count': 0 } })
])"
Tips
- Use query.ts over writing one-off scripts. Use
Promise.allfor parallel operations or an IIFE(async () => { ... })()for complex multi-step logic. ObjectIdis globally available in the query context.- Use
limit(1)orfindOne()to understand schema without wasting tokens. - Use
countDocuments()instead of fetching docs for existence checks.
Repository

rakibdev
Author
rakibdev/dotfiles/home/.config/opencode/skill/mongodb
1
Stars
0
Forks
Updated14h ago
Added6d ago