javascript - object SequelizeInstance being pass -
I am confused and I hope you can help me node using express.js. I am creating an app in J. and want to sequel my ORM. I've created a model with the following code:
"Strict use"; Module Exports = Function (SQLite, datatype) {var user = sealize.define ("user", {username: datatype.STR}}; Return user; }; My route looks like this:
router.get ('/', function (rik, ridge) {models.User.findAll ({ }) .then (function (user) {res.render ('index', {title: 'project insight', user: user});})}} and I am Using EJS for my templates:
for gt; & lt;% (var i = 0; i & lt; users.length; i ++) {%> -
- <% = User [i]%> <%}%> & lt; / ul & gt;
The output coming in my thoughts is:
[Object Sequoise First instance] [Object Sequelance] [Object SequelIst Instance] [Object Sequelence Instance] I want to be able to drag the name from the database and I am confused about why this result Please give me that if I need something, I am new to all of this and I am at a pause. Thanks, for your help already.
Try changing JS template:
& lt East; For & lt;% (var i = 0; i & lt; users.length; i ++) {%> & Lt; Li & gt; & Lt;% = Users [i] Username% & gt; & Lt; / Li & gt; & Lt;%}% & gt; & Lt; / Ul & gt;
Comments
Post a Comment