yurikjke,
Хоть бы отформатировали код...
router.post('/admin/recipes/create_recipe', function (req, res) {
var selectedIngredients = new Array(req.body.ingredients.length);
for(var i = 0; i < req.body.ingredients.length; i++) {
var id = new ObjectId(req.body.ingredients[i]);
Ingredients.findById(id.path, function(err, ingredient) {
console.log(ingredient);
selectedIngredients[i].push(ingredient);
console.log(selectedIngredients[i]);
});
};
console.log(selectedIngredients);
});