nodejs_microblog
nodejs_microblog copied to clipboard
Can I create a feature for adding people with node.js?
Hi, I am a newbie in node.js. I met a question abt adding people in my profile. For example, I have created a picture with html codes: "Add a friend", then, in the backend, I need to write code as below:
{
"type": 0,
"event": {
/* Event body */
"id": ObjectId("4de30eaa12c9c5d5baecae75"),
"addafriend":"Confirm",
"createTime":"Sat, 27 June 2015 20:43:00 + 0000",
"displayPicture": "file\/default_photo.jpg",
"email": "[email protected]",
"friendsList":{
"0": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": ""
}
} } The objectid is the random id created by computer for each people. I need the feature to be shown as below description: When I log into my profile account, I click the "Add a friend" picture icon, it will show an input bar, then I input the username of another person who already is stored in the account list in mongodb, it will automatically add up the person into my friendslist. Can anyone help on this? It is urgent post. Pls pros help!!!