NODE.JS, MONGOOSE, JAVASCRIPT - value from promise doesn't even return null or undefined
I'm not sure if you intended this, but you're running a conditional statement against null
(if(null) {...
) which will always produce a falsey response.
Did you mean if(!res) {...
?
A better approach is to remove your if statement and use:resolve(res ? res : null)