Unsupported OP_QUERY command

I have a simple app which is doing a db.collection().findOne(), and am seeing the 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

Driver is 3.1.13.

I other similar services running a lower driver version, and these appear to be working fine.

As of MongoDB 6.0, legacy opcodes were removed, which means if you’re using a version of the driver that predates MongoDB 3.6 support (where the OP_MSG opcode was introduced), the application will not work.

The Node driver added OP_MSG support with the 3.2.0 release, so if you’re using 3.1.13 this error should be expected.