These are chat archives for Automattic/mongoose

Jan 2019
Karim Mohammadi
Jan 25 15:02

Hi guys. I am beginner to use promises objects.
please guide me. I have declared function myFunc as below:

myFunc = ->
  return User.find({_id: 102086749}).then((fulfilled) ->
    console.log fulfilled
  ).catch (error) ->
    console.log error.message

i want to set result of this declared function to variable user. but printing the user return this message:

Promise <pending>

Is anybody to help me?