Skip to content

MQL (Documents)

Terminal window
curl -X POST https://magnusdb.dev/api/mql/find \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"collection": "articles",
"filter": {"status": "published", "tags": {"$in": ["ai"]}},
"limit": 20
}'
Terminal window
# Single
curl -X POST https://magnusdb.dev/api/mql/insertOne \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"collection": "articles", "document": {"title": "Hello", "status": "draft"}}'
# Batch
curl -X POST https://magnusdb.dev/api/mql/insertMany \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"collection": "articles", "documents": [{"title": "A"}, {"title": "B"}]}'
Terminal window
curl -X POST https://magnusdb.dev/api/mql/updateOne \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"collection": "articles", "filter": {"_id": "123"}, "update": {"$set": {"status": "published"}}}'
curl -X POST https://magnusdb.dev/api/mql/deleteOne \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"collection": "articles", "filter": {"_id": "123"}}'

$eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $and, $or, $not

Complex aggregation stages ($lookup, $facet, $text, $graphLookup) route automatically to MongoDB right-behind when configured.