Currently my project is not working due to this issue, how to fix this

Error [MongoError]: Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal
    at MongoError.create (/Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/cursor.js:212:36)
    at /Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  ok: 0,
  errmsg: 'Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal',
  code: 352,
  codeName: 'UnsupportedOpQueryCommand',
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1734028468 },
    signature: { hash: [Binary], keyId: [Long] }
  },
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1734028468 }
}
Error searching database for update 0.0.1-admins:
Error [MongoError]: Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal
    at MongoError.create (/Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/cursor.js:212:36)
    at /Users/rac/Desktop/Jayaraj/node_modules/keystone/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  ok: 0,
  errmsg: 'Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal',
  code: 352,
  codeName: 'UnsupportedOpQueryCommand',
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1734028468 },
    signature: { hash: [Binary], keyId: [Long] }
  },
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1734028468 }
}
------------------------------------------------
An error occurred applying updates, bailing on Keystone init.

Error details:
MongoError: Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal

i have update mongodb, mongose to latest not nothing works please help me to fix this urgent

You may want to check the package-lock.json to see which version of the mongodb dependency is being used. MongoDB (server) 6.0 removed support for legacy opcodes (such as OP_QUERY), so if you’re getting this error you’re using a version of mongodb that predates support for MongoDB (server) 3.6.

Based on the stack trace it also looks like you’re using the driver from within Keystone, so you may need to check the dependencies there …

1 Like