Builder's DayOctober 26 · SFGet tickets

Be More Productive with MongoDB & Prisma

Bring your developer experience to the next level. Prisma makes it easier than ever to work with your MongoDB database and enables you to query data with confidence.

Why Prisma and MongoDB?

Intuitive Data Modeling

The Prisma schema uses an intuitive modeling language that is easy to read and understand for every team member.

High Productivity & Confidence

Prisma has an intuitive querying API with auto-completion so that you can find the right queries directly in your editor.

Ensured Data Consistency

Prisma’s schema-aware database client ensures that you never bring your data in an inconsistent state.

Fantastic DX

Prisma is well-known for its outstanding developer experience and is loved by developers around the world for it.

First-Class Type-Safety

Prisma provides strong type-safety when used with TypeScript, even for relations and partial queries.

Huge Community & Support

Prisma has a huge Discord community, regularly hosts events and provides helpful support via GitHub.

How Prisma and MongoDB fit together

MongoDB is a powerful NoSQL database that allows developers to intuitively work with their data. However, due to its schemaless nature, developers may run into data inconsistencies as they're evolving their applications. Prisma is a next-generation ORM/ODM that makes it easier to ensure data consistency by providing an easy-to-read schema and a type-safe database client with auto-completion for all queries.

Reading data in MongoDB with Prisma Client

Prisma Client provides a powerful API for reading data in MongoDB, including filters, pagination, ordering and relational queries for embedded documents and reference-based relations.

const usersWithProfile = await prisma.user.findMany({
  where: {
    profile: {
      isSet: true,
    },
  },
  select: {
    id: true,
    profile: {
      select: {
        profilePicture: true,
      },
    },
    posts: {
      where: {
        published: true,
      },
    },
  },
  take: 10,
  orderBy: {
    profile: {
      firstName: "asc",
    },
  },
});
We believe that the combination of MongoDB Atlas Serverless and Prisma Accelerate will greatly simplify the process of building and deploying serverless applications in the cloud, especially for workloads that need to scale to high connection counts.

Kevin Jernigan

Principal Product Manager, MongoDB

Our MongoDB Resources

Using Prisma with MongoDB

In this guide, you will learn about the concepts behind using Prisma and MongoDB, the commonalities and differences between MongoDB and other database providers, and the process for configuring your application to integrate with MongoDB using Prisma.

MongoDB in the Data Guide

Learn how to use MongoDB to its fullest to take advantage of the performance and features that developers have grown to rely on.

Watch

In this episode of What's New in Prisma, Matt takes you through a demo of the embedded document support in MongoDB.