I want to search through a table for a particular string. I can find the row when the tag matches the contents exactly. But I want to find all occurrences of "red" even when the tags column has multiple colors in a string like "blue, green, purple, red". Is it possible to use SQL to query? I found a vague reference involving chaining but it wasn't clear how to make it work in this case.
Here's what I have for the exact match...
app.post("/admin/search", function(req, res) { var data = req.body; req.models.images.find({tags:data.tags}, function(err, results) { res.send(results); //Returns on perfect match }); }