These are chat archives for Automattic/mongoose

25th
Jan 2019
Karim Mohammadi
@skmohammadi_gitlab
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
    return
  ).catch (error) ->
    console.log error.message
    return

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?