Here's my current code:
Model.containing(req.user.location, function(err, models) {
if (err) throw err;
res.render('models/index', {title: 'Models', models: models});
});
I get a list of models that contain the user's location. It works great. Now I want to get all of those previous models and one extra. I could retrieve this extra model with something like:
Model.find().where('name').equals('desired name').exec(function(err, models) {
//got my models!
});
Could I combine them to do something like this?
Model.containing(req.user.location, function(err, models) {
if (err) throw err;
Model.find().where('name').equals('desired name').exec(function(err, newModels) {
var allModels = models + newModels;
res.render('models/index', {title: 'Models', models: allModels});
});
});
Thanks!