Last Updated: Aug 20, 2024
Overview
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
Applies To
- Custom Database
- Mongo templates
Cause
The Mongo package on the Custom DB template is outdated.
Solution
- Find the latest mongodb package version available here.
- Navigate to the custom database and go to the tab called “Custom Database”. There should be the database scripts.
- Set the MongoDB package version to the version we found above. Example:
const MongoClient = require(‘mongodb@5.1.0’).MongoClient;