Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
prisma replace reference to GraphQL Conf with Prisma Day Apr 12, 2019
src prettier Feb 5, 2019 add Docker MongoDB example for TS Dec 13, 2018
docker-compose.yml update to v1.34 May 28, 2019
package.json Update dependency @types/graphql to v14.2.1 Jun 16, 2019
tsconfig.json add Docker MongoDB example for TS Dec 13, 2018

MongoDB with Docker Example

This example shows how to set up Prisma using Docker and MongoDB locally on your machine. It then uses the Prisma client in a simple TypeScript script to read and write data in the database.

When using MongoDB with Prisma, you use a new datamodel format. Learn more in the docs.

How to use

1. Download example & install dependencies

Clone the repository:

git clone

Install Node dependencies:

cd prisma-examples/typescript/docker-mongodb
npm install

2. Launch Prisma with Docker

This example is based on Docker. If you don't have Docker installed, you can get it from here. Use the Docker Compose CLI to launch the Docker containers specified in docker-compose.yml:

docker-compose up -d

3. Install the Prisma CLI

To run the example, you need the Prisma CLI. Please install it via NPM or using another method:

npm install -g prisma

4. Set up database & deploy Prisma datamodel

To deploy the datamodel for this example, run the following command:

prisma deploy

5. Run the script

Execute the script with this command:

npm run start

Next steps

You can’t perform that action at this time.