Database Connector (Mongo)
A database connector is the bridge between Prisma and the underlying database. The MongoDB connector is used to connect a Prisma server to a MonogDB database.
The core responsibilities of a database connector are:
- Translate requests from the Prisma client into MongoDB API calls
- Execute the generated API call against the database
- Return the result from the database back to the Prisma client
When configuring your Prisma server with Docker, you need to specify which connector you'd like to use in order to connect to a certain database. You provide this info via the
PRISMA_CONFIG: | managementApiSecret: __YOUR_MANAGEMENT_API_SECRET__ port: 4466 databases: default: connector: mongo uri: __YOUR_MONGO_DB_CONNECTION_STRING__Copy
Managing database connections
connectionLimit property in
PRISMA_CONFIG determines the number of database connections a Prisma service is going to use.
connectionLimit needs to be set to at least 2. One connection is always reserved for the Management API, all other connections are used for the Prisma service.
Prisma currently maintains a collection called
_RelayId. This collection is there for historic reasons and will be removed soon.