Mongodb – SyntaxError: await is only valid in async functions and the top level bodies of modules – NodeJS
I am trying to create user login and sign up in NodeJS with mongoDB, but in login module i am getting this error - existingUser = await User.findOne({email: email}); ^^^^^ SyntaxError: await is only valid in async functions and the…