Nodejs Not Showing Full Data to Front End? ? Json transmission

  node.js, question

First of all, thank you for helping me look at this problem. Thank you very much.

Describe the problem

  1. The Express framework of Node.js is adopted as a whole.

  2. I read a comment object of an answer (answerComment) and then read the author’s information (also an object) of the comment according to its author’s IDauthor)

  3. viaanswerComment.author = author;, assign a value, and then pass theconsole.log(answerComment.author);The value of author is displayed.

  4. But throughres.status(200).json({comment: answerComment});This sentence is passed at the front end when transmitting data to the front end.var response = JSON.parse(request.responseText);After obtaining the response, use theconsole.log(response.answerComment.author)It isundefined, outputconsole.log(response.answerComment)The data of is data, the form is as follows:

bracket
 "__v":0,
 "content":"de",
 "author_id":"56e5944be3f709ad4c0395db",
 "_id":"56efb9e40e28dd4427fd23a9",
 "comment_count":0,
 "deleted":false,
 "dislikes":[],
 "likes":[],
 "update_at":"2016-03-21T09:07:48.105Z",
 "create_at":"2016-03-21T09:07:48.105Z"
 bracket

My question is why after assigning a value to an object, the output of the object can be displayed at the back end, but it cannot be displayed at the front end. Is it undefined? ? ? ? ?

response.anserCommentThis object is not withoutauthorIs it? Onlyauthor_id~~