[SandboxUnhandledError] db is not defined

Hi,

I am trying to create a user from custom db (mongo db) → create user → try.

But when I fill in user and pwd ; I have this error [SandboxUnhandledError] db is not defined

With login it’s working.
Could you please help me?

Thanks,

Btw , here is my beginning of my code :

function create (user, callback) {
  mongo('mongodb://username:pwd@myurl/mydb', function (db) {
    
    var users = db.collection('users');
...