Hi
i'm a beginer in node and i'm struggled with a behavior.
In my route
var list_subscriber_projects ;
var list_subscriber_projects_request = Subscriber.find({ user_email:
req.params.user_email });
var list_subscriber_projects_promise =
list_subscriber_projects_request.exec( );
list_subscriber_projects_promise.addBack(function ( err,
list_subscriber_projects_result ){
if( err ) return next( err );
console.log("1 - test ------> " + list_subscriber_projects_result);
console.log("2 - test------> " +
list_subscriber_projects_result.subscriptions);
list_subscriber_projects = list_subscriber_projects_result;
});
console.log("3 - test------> " + list_subscriber_projects);
And in my console i'm getting :
3 - test------> undefined
1 - test ------> { __v: 1,
_id: 543beeeefc966c642e5fa2e2,
user_email: '[email protected]',
subscriptions:
[ { project_name: 'ffffff',
_id: 543d21761ad0e1cc18c639af } ] }
2 - test------> undefined
So my question is why log test 1 tells me that the object has subscriptions
property and when trying to access these property log test 2 tells that it
is undifined
and then when i copy in an other object i have also undifined ?
Thanks
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/2b8521be-1782-4b68-9bfb-d2018f6ceff4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.