Prisma 提供了数据库工具,这些工具是使用出色的 DX 构建高性能 Next.js 应用程序的完美伴侣。
Prisma Postgres 是第一个没有冷启动的无服务器数据库。它基于unikernels,在裸机上运行,并带有一个内置缓存、高性能查询和无缝扩展——所有这些都具有出色的 DX。
了解有关 Prisma Postgres 的更多信息→MongoDB 是一个功能强大的 NoSQL 数据库,允许开发人员直观地使用他们的数据。然而,由于其无模式特性,开发人员在开发应用程序时可能会遇到数据不一致的问题。
Prisma 是下一代 ORM/ODM,它通过提供易于阅读的模式和具有所有查询自动完成功能的类型安全数据库客户端,使数据一致性更容易得到保证。
Prisma Client 提供了一个强大的 API,用于读取 MongoDB 中的数据,包括嵌入式文档和基于引用的关系,进行过滤、分页、排序和关系查询。
1const usersWithProfile = await prisma.user.findMany({2 where: {3 profile: {4 isSet: true,5 },6 },7 select: {8 id: true,9 profile: {10 select: {11 profilePicture: true,12 },13 },14 posts: {15 where: {16 published: true,17 },18 },19 },20 take: 10,21 orderBy: {22 profile: {23 firstName: "asc",24 },25 },26 });
Prisma Client 提供了一个强大的 API,用于读取 MongoDB 中的数据,包括嵌入式文档和基于引用的关系,进行过滤、分页、排序和关系查询。
1const usersWithProfile = await prisma.user.findMany({2 where: {3 profile: {4 isSet: true,5 },6 },7 select: {8 id: true,9 profile: {10 select: {11 profilePicture: true,12 },13 },14 posts: {15 where: {16 published: true,17 },18 },19 },20 take: 10,21 orderBy: {22 profile: {23 firstName: "asc",24 },25 },26 });
“我们相信 MongoDB Atlas Serverless 和 Prisma Accelerate 的结合将极大地简化在云中构建和部署无服务器应用程序的过程,特别是对于需要扩展到高连接数的负载。”
Prisma 模式使用一种直观的建模语言,易于所有团队成员阅读和理解。
Prisma 具有直观的查询 API,带有自动完成功能,因此您可以在编辑器中直接找到正确的查询。
Prisma 的模式感知数据库客户端确保您永远不会使数据处于不一致状态。
Prisma 以其出色的开发者体验而闻名,并因此受到全球开发者的喜爱。
Prisma 在与 TypeScript 一起使用时提供强大的类型安全,即使对于关系和部分查询也是如此。
Prisma 拥有庞大的 Discord 社区,定期举办活动,并通过 GitHub 提供有用的支持。
在本指南中,您将了解使用 Prisma 和 MongoDB 背后的概念,MongoDB 与其他数据库提供程序之间的异同,以及配置应用程序以使用 Prisma 与 MongoDB 集成的过程。
了解如何充分利用 MongoDB,以利用开发人员所依赖的性能和功能。
我们有多个渠道,您可以与我们的社区成员以及 Prisma 团队互动。