Using dynamic search parameters with Sequelize.js

Now on Sequelize you can try this

{ where: { columnName: { $like: '%awe%' } } }

See http://docs.sequelizejs.com/en/latest/docs/querying/#operators for updated syntax


I think you would do that like this:

where: ["title like ?", '%' + 'awe' + '%']

So if you were doing this with an actual variable you'd use:

Project.findAll({where: ["title like ?", '%' + x + '%']}).success(function(projects) {
    for (var i=0; i<projects.length; i++) {
        console.log(projects[i].title + " " + projects[i].description);
    }
});