This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports.searchResults = function(req, res){ | |
| var search = req.body.search; | |
| console.log("query:" + search); | |
| renderSearchResults(req, res); | |
| }; | |
| // the type of form should be posted, req.body can only get the posted data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| responseBody[object Object],[object Object],[object Object] | |
| These two vars are equal. | |
| GET /locationlist/ 500 197.178 ms - 1964 | |
| GET /bootstrap/css/pulse.bootstrap.css 304 1.410 ms - - | |
| // Why would this error happen? | |
| // The reason might be that the data in the view cannot match the controller. | |
| GET / 500 19.940 ms - 1838 | |
| GET /bootstrap/css/pulse.bootstrap.css 304 1.349 ms - - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // error message: | |
| 5:55:25 PM web.1 | /home/sheng/Work/smr_pjt_loct_dr/app_server/controllers/locations.js:52 | |
| 5:55:25 PM web.1 | if (response.statusCode === 200 && data.length) { | |
| 5:55:25 PM web.1 | ^ | |
| 5:55:25 PM web.1 | TypeError: Cannot read property 'statusCode' of undefined | |
| 5:55:25 PM web.1 | at Request._callback (/home/sheng/Work/smr_pjt_loct_dr/app_server/controllers/locations.js:52:15) | |
| 5:55:25 PM web.1 | at self.callback (/home/sheng/Work/smr_pjt_loct_dr/node_modules/request/request.js:188:22) | |
| // and it is actually weird, trying to figure out... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // But when input the exact the same coordinate of a place I have stored in the database, it would be revealed. | |
| // As for GeoJSON format, the unit of distance is meters. | |
| // GeoJSON Multipoint require 2dsphere: | |
| { | |
| type: "MultiPoint", | |
| coordinates: [ | |
| [ -73.9580, 40.8003 ], | |
| [ -73.9498, 40.7968 ], | |
| [ -73.9737, 40.7648 ], | |
| [ -73.9814, 40.7681 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The reason is that the id()method only match the field whose name is _id. | |
| // The id of subdocument can be specified using ObjectID(), but it need to be specified into a form of _id. | |
| "reviews" : [ | |
| { | |
| "author" : "Jack Lee", | |
| "_id" : ObjectId("5937bd3e8f3da38b9429bba2"), | |
| "rating" : 5, | |
| "timestamp" : ISODate("2017-05-15T23:00:00Z"), | |
| "reviewText" : "Quite, and the coffee is yummy!!!" | |
| } |
NewerOlder