diff --git a/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js b/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js
index 067bf1482f..215f4c661b 100644
--- a/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js
+++ b/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js
@@ -52,9 +52,9 @@ const txnNum = transactionEntry.txnNum;
jsTestLog("Test that updates to config.transactions fails when there is a prepared " +
"transaction on the session");
assert.commandFailedWithCode(
- sessionConfigDB.transactions.update({_id: transactionEntry._id},
+ config.transactions.update({_id: transactionEntry._id},
{$set: {"txnNumber": NumberLong(23)}}),
- 40528);
+ 267);
transactionEntry = config.transactions.findOne();
@@ -62,8 +62,8 @@ assert.eq(transactionEntry.txnNum, NumberLong(txnNum));
jsTestLog("Test that deletes to config.transactions fails when there is a prepared " +
"transaction on the session");
-assert.commandFailedWithCode(sessionConfigDB.transactions.remove({_id: transactionEntry._id}),
- 40528);
+assert.commandFailedWithCode(config.transactions.remove({_id: transactionEntry._id}),
+ 267);
transactionEntry = config.transactions.findOne();
@@ -72,9 +72,9 @@ assert(transactionEntry);
jsTestLog("Test that dropping config.transactions fails when there is a prepared transaction" +
" on the session");
assert.commandFailedWithCode(assert.throws(function() {
- sessionConfigDB.transactions.drop();
+ config.transactions.drop();
}),
- 40528);
+ 267);
jsTestLog("Test that we can prepare a transaction on a different session");
const session2 = db.getMongo().startSession({causalConsistency: false});