We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8389a35 commit 4b4ccdfCopy full SHA for 4b4ccdf
src/operations/execute_operation.ts
@@ -122,7 +122,7 @@ export async function executeOperation<
122
if (
123
inTransaction &&
124
!readPreference.equals(ReadPreference.primary) &&
125
- operation.hasAspect(Aspect.READ_OPERATION)
+ (operation.hasAspect(Aspect.READ_OPERATION) || operation.commandName === 'runCommand')
126
) {
127
throw new MongoTransactionError(
128
`Read preference in a transaction must be primary, not: ${readPreference.mode}`
0 commit comments