pref: set strictQuery to throw. (#3994)

This commit is contained in:
Finley Ge
2025-03-06 18:24:58 +08:00
committed by GitHub
parent 90d13ee3df
commit 08b6f594df

View File

@@ -19,7 +19,7 @@ export async function connectMongo(): Promise<Mongoose> {
// Remove existing listeners to prevent duplicates
connectionMongo.connection.removeAllListeners('error');
connectionMongo.connection.removeAllListeners('disconnected');
connectionMongo.set('strictQuery', false);
connectionMongo.set('strictQuery', 'throw');
connectionMongo.connection.on('error', async (error) => {
console.log('mongo error', error);