Skip to content

Commit 90f88f8

Browse files
authored
fix(db-mongodb): beginTransaction invalid type without replicaset (#10690)
Fixes #10603
1 parent be98eda commit 90f88f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/db-mongodb/src/connect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ConnectOptions } from 'mongoose'
22
import type { Connect } from 'payload'
33

44
import mongoose from 'mongoose'
5+
import { defaultBeginTransaction } from 'payload'
56

67
import type { MongooseAdapter } from './index.js'
78

@@ -46,7 +47,7 @@ export const connect: Connect = async function connect(
4647

4748
if (!client.options.replicaSet) {
4849
this.transactionOptions = false
49-
this.beginTransaction = undefined
50+
this.beginTransaction = defaultBeginTransaction()
5051
}
5152

5253
if (!this.mongoMemoryServer && !hotReload) {

0 commit comments

Comments
 (0)