MongoError: Unsupported OP_QUERY command: find. The client driver may require an upgrade

Hi, I’m upgrading my Atlas MongoDB from 5.x to 6.x and ran into this error on my Meteor test server:

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’m not sure how to check my current client driver version or how to upgrade my client driver. Can someone please help point me in the right direction?

Thanks!

What Meter version are you on with your test server?

Thanks for your reply!

The test server is on Meteor version 1.5.2. (It’s an old code base that hasn’t been updated in a long time.)

Ok. In the Meteor page in Github, you can select the release version (use Tags). Your Mongo driver version is here: meteor/packages/npm-mongo/package.js at release/METEOR@1.5.2.2 · meteor/meteor · GitHub

The compatibility chart is right here: https://www.mongodb.com/docs/drivers/node/current/compatibility/

Screenshot 2024-05-15 at 10.31.12 AM

Thanks for the info.

It looks like the MongoDB version is 2.2.30 and needs to be updated to 3.2 according to the compatibility chart. Do you have suggestions on how I can do that without updating my Meteor version? (Fwiw, my app is in an old state and when I try to update my Meteor version, the app breaks.)

I can only think of a Meteor upgrade/ rewrite project or dump the DB and self host on your preferred old version of Mongo.

Between your version of Meteor and the one compatible with Mongo DB 6, Node moved from 4 to 8 and ECMAScript (ES6) was introduced in Meteor.

You could try a local package for npm-mongo and run it from there with your upgraded version of the driver but chances are that it will have incompatibilities due to … different generations of technology.

If you go this way and things work with no other changes, lucky you. If not, you will have to follow a long line of history and release updates in both Meteor and Mongo and see the deprecations and breaking changes.
If you need help with creating a local package, wave a hand, send some smoke signals.

1 Like

Yes, please! I could use help with creating a local package.

Btw, do you happen to do consulting/contract work or know of anyone who does?

Chatgpt suggested this in response to your message as a prompt. Does its solution implement your suggestion properly? (I apologize for the naivete. I’m out of date on this stuff.)

If you prefer not to upgrade Meteor incrementally or if it causes too many issues, you can try using a local version of the npm-mongo package with an updated MongoDB driver:

  1. Clone the npm-mongo Package:
  • Clone the npm-mongo package into your local packages directory:

bash

Copy code

meteor create --package local:npm-mongo
cd packages
git clone https://github.com/meteor/meteor.git -b release/METEOR@1.5.2 npm-mongo
  1. Update the MongoDB Driver:
  • Navigate to the npm-mongo package directory and update the MongoDB driver to the latest version:

bash

Copy code

cd npm-mongo
npm install mongodb@latest
  1. Update the Package:
  • Modify the package.js file of the npm-mongo package to use the updated driver.
  1. Include the Local Package:
  • In your main Meteor project directory, include the local package:

bash

Copy code

meteor add local:npm-mongo
  1. Test and Debug:
  • Test your application to see if it works with the updated MongoDB driver. If there are compatibility issues, you may need to adjust your code to accommodate the newer MongoDB driver.

Hey @epeng, I do not do contract work but I am sure there would be people on the forum who would love to take on this task.