From 42c06acd18448efb7a529bc1de4e67a0732c0887 Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Tue, 12 Dec 2023 14:44:07 -0500 Subject: [PATCH] docs: transaction options --- docs/database/mongodb.mdx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/database/mongodb.mdx b/docs/database/mongodb.mdx index 624fb2beb0..4682b99b50 100644 --- a/docs/database/mongodb.mdx +++ b/docs/database/mongodb.mdx @@ -6,7 +6,8 @@ desc: Payload has supported MongoDB natively since we started. The flexible natu keywords: MongoDB, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express --- -To use Payload with MongoDB, install the package `@payloadcms/db-mongodb`. It will come with everything you need to store your Payload data in MongoDB. +To use Payload with MongoDB, install the package `@payloadcms/db-mongodb`. It will come with everything you need to +store your Payload data in MongoDB. Then from there, pass it to your Payload config as follows: @@ -29,16 +30,18 @@ export default buildConfig({ ### Options -| Option | Description | -| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `autoPluralization` | Tell Mongoose to auto-pluralize any collection names if it encounters any singular words used as collection `slug`s. | -| `connectOptions` | Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. | -| `disableIndexHints` | Set to true to disable hinting to MongoDB to use 'id' as index. This is currently done when counting documents for pagination, as it increases the speed of the count function used in that query. Disabling this optimization might fix some problems with AWS DocumentDB. Defaults to false | -| `migrationDir` | Customize the directory that migrations are stored. | +| Option | Description | +|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `autoPluralization` | Tell Mongoose to auto-pluralize any collection names if it encounters any singular words used as collection `slug`s. | +| `connectOptions` | Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. | +| `disableIndexHints` | Set to true to disable hinting to MongoDB to use 'id' as index. This is currently done when counting documents for pagination, as it increases the speed of the count function used in that query. Disabling this optimization might fix some problems with AWS DocumentDB. Defaults to false | +| `migrationDir` | Customize the directory that migrations are stored. | +| `transactionOptions` | An object with configuration properties used in [transactions](https://www.mongodb.com/docs/manual/core/transactions/) or `false` which will disable the use of transactions. | | ### Access to Mongoose models -After Payload is initialized, this adapter exposes all of your Mongoose models and they are available for you to work with directly. +After Payload is initialized, this adapter exposes all of your Mongoose models and they are available for you to work +with directly. You can access Mongoose models as follows: