Repository navigation
EN MongoDB
English · Türkçe · Languages / Diller
Scope: JSON API Forge 0.5.1 · Source review: 17 September 2026 · Language: English
MongoDB support uses PyMongo's asynchronous client. Configure mongo_databases and mongo_resources instead of SQL databases and resources.
{
"mongo_databases": {
"primary": {"uri": "$env:MONGO_URI", "database": "notes"}
},
"mongo_resources": [
{
"database": "primary", "collection": "notes", "path": "mongo-notes",
"writable_fields": ["title", "status"],
"allowed_filters": ["status"],
"allowed_sort": ["title"],
"permissions": {
"list": "mongo.notes.list", "read": "mongo.notes.read",
"create": "mongo.notes.create", "update": "mongo.notes.update", "delete": "mongo.notes.delete"
}
}
]
}Grant the necessary permissions to your application role. This fragment does not install MongoDB or automatically manage database-side users and privileges.
Mongo resources support collections, allowlists, payload schemas, hidden fields, pagination, tenants, ownership and soft-delete policies. SQL column DDL and SQL statement transactions do not transfer directly to this model. Follow the endpoint contract for ObjectId-shaped or native string identifiers.
Mongo filters have a smaller operator set: eq, ne, gt, gte, lt, lte, in. The API does not grant arbitrary raw Mongo query access by accepting operators in the request body or query.
Tenant/owner/soft-delete fields remain server-controlled and should not be client-writable. owner_actions and bypass permissions have a similar security purpose to SQL policies, but require testing across users and tenants against a real MongoDB service.
Manage pool sizing, server-selection timeout, credentials and network allowlists explicitly. forge migrate is not a general MongoDB index/schema migration system. Version MongoDB indexes and data transformations separately. Real integration tests catch connection, driver and CRUD behavior that mocks cannot establish.
This page describes the behavior at the pinned commits below. Recheck these contracts when upgrading.