mongodb-query
Query MongoDB notes store for memory analysis and statistics.
Works with
---
name: mongodb-query
description: Query MongoDB notes store for memory analysis and statistics.
license: MIT
---
# MongoDB Query Skill
Query the MongoDB notes store to investigate memory contents, embeddings, and note statistics.
## Connection Details
- **URI**: `mongodb://localhost:27017` (or `MONGODB_URI` env var)
- **Database**: `qq_memory`
- **Collection**: `notes`
## Python Usage
```python
from qq.memory.mongo_store import MongoNotesStore
# Initialize store
store = MongoNotesStore()
# Get a specific note
note = store.get_note("note_id_here")
# Get recent notes
recent = store.get_recent_notes(limit=10)
# Get notes by importance range
important = store.get_by_importance_range(min_importance=0.7, max_importance=1.0)
# Get stale notes (not accessed recently)
stale = store.get_stale_notes(days_threshold=30)
```
## Direct PyMongo Usage
```python
from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017")
db = client["qq_memory"]
notes = db["notes"]
# Count all notes
total = notes.count_documents({})
# Find all notes
all_notes = list(notes.find({}, {"content": 1, "section": 1, "importance": 1}))
# Count by section
pipeline = [
{"$group": {"_id": "$section", "count": {"$sum": 1}}},
{"$sort": {"count": -1}}
]
by_section = list(notes.aggregate(pipeline))
# Find notes without embeddings
no_embedding = notes.count_documents({"embedding": None})
# Sample notes
sample = list(notes.find().limit(10))
```
## CLI Usage
```bash
# Use mongosh directly
docker exec -it qq-mongodb-1 mongosh qq_memory --eval "db.notes.countDocuments({})"
# Get collection stats
docker exec -it qq-mongodb-1 mongosh qq_memory --eval "db.notes.stats()"
```
## Notes Schema
Each note document contains:
- `note_id`: Unique identifier
- `content`: Note text
- `embedding`: Vector embedding (list of floats)
- `section`: Category (e.g., "Key Topics", "Preferences")
- `metadata`: Additional key-value pairs
- `importance`: Score 0.0-1.0 (default 0.5)
- `decay_rate`: How fast importance decays (default 0.01)
- `access_count`: Number of times accessed
- `last_accessed`: Timestamp of last access
- `created_at`: Creation timestamp
- `updated_at`: Last update timestampMore Database skills
prisma-mongodb-upgrade
prisma/skills
Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma Next. Triggers on "upgrade prisma mongodb", "prisma 7 mongodb", "mongodb prisma migration", "prisma next mongodb".
azure-upgrade
microsoft/azure-skills
Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed Redis (AMR).
azure-cost-optimization
microsoft/azure-skills
Identify Azure cost savings from usage and spending data. USE FOR: optimize Azure costs, reduce Azure spending/expenses, analyze Azure costs, find cost savings, generate cost optimization report, identify orphaned resources to delete, rightsize VMs, reduce waste, optimize Redis costs, optimize storage costs, AKS cost analysis add-on, namespace cost, cost spike, anomaly, budget alert, AKS cost visibility. DO NOT USE FOR: deploying resources (use azure-deploy), general Azure diagnostics (use azure-diagnostics), security issues (use azure-security)

