123
rated 0 times
[
127]
[
4]
/ answers: 1 / hits: 24870
/ 13 Years ago, fri, february 17, 2012, 12:00:00
I'm trying to follow the Sequelize tutorial on their website.
I have reached the following line of code.
Project.findAll({where: [id > ?, 25]}).success(function(projects) {
// projects will be an array of Projects having a greater id than 25
})
If I tweak it slightly as follows
Project.findAll({where: [title like '%awe%']}).success(function(projects) {
for (var i=0; i<projects.length; i++) {
console.log(projects[i].title + + projects[i].description);
}
});
everything works fine. However when I try to make the search parameter dynamic as follows
Project.findAll({where: [title like '%?%', 'awe']}).success(function(projects) {
for (var i=0; i<projects.length; i++) {
console.log(projects[i].title + + projects[i].description);
}
});
It no longer returns any results. How can I fix this?
More From » node.js