Custom DB Mongo error: Unsupported OP_QUERY command

Problem statement

Custom DB with Mongo template returns the following error:
Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal

Symptoms

  • Log in doesn’t work with a custom DB using Mongo.

Cause

  • The Mongo package on the Custom DB template is outdated.

Solution

We recommend finding the latest Mongodb package version available at Can I require? - Search which node modules you can use in webtask.io

Navigate to your custom DB and go to the tab called "Custom Database ", you will find the DB scripts:

Set the MongoDB package version to the version found above.

For example:

const MongoClient = require('[mongodb@5.1.0](mailto:mongodb@5.1.0)').MongoClient;
1 Like