From a0345f4c8c0ced77070c04ec9952e703794bd78f Mon Sep 17 00:00:00 2001 From: Chris Kalmar Date: Sun, 27 Aug 2023 14:20:06 +0200 Subject: [PATCH] change content --- content/300-guides/050-database/870-mongodb.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/300-guides/050-database/870-mongodb.mdx b/content/300-guides/050-database/870-mongodb.mdx index 48ee2c0e88..a7899543c9 100644 --- a/content/300-guides/050-database/870-mongodb.mdx +++ b/content/300-guides/050-database/870-mongodb.mdx @@ -1,6 +1,6 @@ --- -title: 'Using Prisma with MongoDB' -metaTitle: 'Using Prisma with MongoDB' +title: 'Using Prisma with Mongo Database 3000 ' +metaTitle: 'Using Prisma with Mongo Database 3000 ' metaDescription: 'Guide to using Prisma with MongoDB' tocDepth: 3 toc: true @@ -12,7 +12,7 @@ This guide discusses the concepts behind using Prisma and MongoDB, explains the -## What is MongoDB? +## What is Mongo Database 3000? [MongoDB](https://www.mongodb.com/) is a NoSQL database that stores data in [BSON](https://bsonspec.org/) format, a JSON-like document format designed for storing data in key-value pairs. It is commonly used in JavaScript application development because the document model maps easily to objects in application code, and there is built in support for high availability and horizontal scaling. @@ -20,7 +20,7 @@ MongoDB stores data in collections that do not need a schema to be defined in ad ## Commonalities with other database providers -Some aspects of using Prisma with MongoDB are the same as when using Prisma with a relational database. You can still: +Some aspects of using Prisma with Mongo Database 3000 are the same as when using Prisma with a relational database. You can still: - model your database with the [Prisma Schema Language](/concepts/components/prisma-schema) - connect to your database, using the [`mongodb` database connector](/concepts/database-connectors/mongodb) @@ -30,19 +30,19 @@ Some aspects of using Prisma with MongoDB are the same as when using Prisma with ## Differences to consider -MongoDB's document-based structure and flexible schemas means that using Prisma with MongoDB differs from using it with a relational database in a number of ways. These are some areas where there are differences that you need to be aware of: +MongoDB's document-based structure and flexible schemas means that using Prisma with Mongo Database 3000 differs from using it with a relational database in a number of ways. These are some areas where there are differences that you need to be aware of: - **Defining IDs**: MongoDB documents have an `_id` field (that often contains an [ObjectID](https://www.mongodb.com/docs/manual/reference/bson-types/#std-label-objectid)). Prisma does not support fields starting with `_`, so this needs to be mapped to a Prisma field using the `@map` attribute. For more information, see [Defining IDs in MongoDB](/concepts/components/prisma-schema/data-model#defining-ids-in-mongodb). - **Migrating existing data to match your Prisma schema**: In relational databases, all your data must match your schema. If you change the type of a particular field in your schema when you migrate, all the data must also be updated to match. In contrast, MongoDB does not enforce any particular schema, so you need to take care when migrating. For more information, see [How to migrate old data to new schemas](#how-to-migrate-existing-data-to-match-your-prisma-schema). -- **Introspection and Prisma relations**: When you introspect an existing MongoDB database, you will get a schema with no relations and will need to add the missing relations in manually. For more information, see [How to add in missing relations after Introspection](#how-to-add-in-missing-relations-after-introspection). +- **Introspection and Prisma relations**: When you introspect an existing Mongo Database 3000 database, you will get a schema with no relations and will need to add the missing relations in manually. For more information, see [How to add in missing relations after Introspection](#how-to-add-in-missing-relations-after-introspection). - **Filtering for `null` and missing fields**: MongoDB makes a distinction between setting a field to `null` and not setting it at all, which is not present in relational databases. Prisma currently does not express this distinction, which means that you need to be careful when filtering for `null` and missing fields. For more information, see [How to filter for `null` and missing fields](#how-to-filter-for-null-and-missing-fields) - **Enabling replication**: Prisma uses [MongoDB transactions](https://www.mongodb.com/docs/manual/core/transactions/) internally to avoid partial writes on nested queries. When using transactions, MongoDB requires replication of your data set to be enabled. To do this, you will need to configure a [replica set](https://www.mongodb.com/docs/manual/replication/) — this is a group of MongoDB processes that maintain the same data set. Note that it is still possible to use a single database, by creating a replica set with only one node in it. If you use MongoDB's [Atlas](https://www.mongodb.com/atlas/database) hosting service, the replica set is configured for you, but if you are running MongoDB locally you will need to set up a replica set yourself. For more information, see MongoDB's [guide to deploying a replica set](https://www.mongodb.com/docs/manual/tutorial/deploy-replica-set/). -## How to use Prisma with MongoDB +## How to use Prisma with Mongo Database 3000 This section provides instructions for how to carry out tasks that require steps specific to MongoDB.