MQL (Documents)
Find documents
Section titled “Find documents”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 }'Insert
Section titled “Insert”# Singlecurl -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"}}'
# Batchcurl -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"}]}'Update and delete
Section titled “Update and delete”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"}}'Supported filter operators
Section titled “Supported filter operators”$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.