Re: [nodejs] Transferring a JSON have values of different types

2019-03-30 Thread Chaiwa Berian
JSON can have data represented in about 5 primitive data types: String, Number, Array, Boolean, and Null. So if you are using express, and you have a javascript object that you would like to send to the client as json, the data fields(or object properties) will be cast to any of the respective data

[nodejs] Re: Transferring a JSON have values of different types

2019-03-30 Thread Chaiwa Berian
JSON can have data represented in about 5 primitive data types: String, Number, Array, Boolean, and Null. So if you are using express, and you have a javascript object that you would like to send to the client as json, the data fields(or object properties) will be cast to any of the respective

[nodejs] Express API model MVC - Error : connection.query is not a function

2019-06-27 Thread Chaiwa Berian
In index.js you are not exporting the connection object, you are only exporting router object. That is why you are getting the error when you reference connection object in booksModel.js. You could try the following: Step 1: In index.js include connection in the module exports as below: module.ex