I am working with monk, and when I look for a user in the database using a function, I want their to return a boolean depending on if its found or not. Here is the code:
Function:
function userExist() {
users
.find()
.then(result => {
console.log(result)
if(result.length != 0) {
return true;
} else {
return false;
}
})
}
calling the function(here is the error):
userExist().then(received => {
console.log(received);
})