Auth0 Home Blog Docs

[SandboxUnhandledError] db is not defined

custom-database
not-working
save-users-to-db

#1

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,


#2

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');
...

#3