Hi @kristina71103, welcome to the Auth0 Community.
In your code, try to initialize the MongoClient with the following code instead:
const MongoClient = require('mongodb@4.1.0').MongoClient;
And please let me know if that solves your issue. Thanks