Substitute for user.findone?

98 views Asked by At

Please bear with me. I am a complete noob with js and have just started learning a few weeks ago. I am trying out jwt-passport strategy with a static user.json file instead of mongo.db and am stumped at this line

User.findOne({_id: jwt_payload.sub}, function(err, user) {
        

I have tried foreach, if statements, but am not getting the same results. What method or function should I use to get the se results? I understand from mongoose docs tt the above code is returning a user's payload_jwt.sub as defined in another file.enter image description here

0

There are 0 answers