이나경

Modify code for mongoDB

......@@ -18,5 +18,18 @@ var options = {
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
\ No newline at end of file
var jason = response.body
var json = JSON.parse(jason)
const data = {}
for (var i in json["rows"]){
var obj = {};
obj['name'] = json["rows"][i]["subjt_name"];
obj['time'] = json["rows"][i]["timetable"];
obj['prof'] = json["rows"][i]["teach_na"];
obj['credit'] = json["rows"][i]["unit_num"];
console.log(obj);
}
});
......