title: How to send headers after loop
body: <p>I want to do find an user, whose model contains an array of cities (for example:[Madrid, London, Moscow, Buenos Aires, etc])</p>
  
  <p>This is the model:</p>
  
  <pre><code>var UserSchema = Schema({
      name: String,
      surname: String,
      userName: String,
      email: String,
      password: String,
      rol: String,
      suscriptionDate: Date,
      cities:[String],
      citiesPopulate:[]
  });
  </code></pre>
  
  <p>Once I've found the user, I want to iterate through this array to use each city as the parameter in order to find the info that I have on the model City just to add coords to user.citiesPopulate</p>
  
  <pre><code>function findUsersCities(req,res){
      let id=req.body._id;
  
      User.findById(id,function(err,userFound){
          if(err){
              console.log(err)
          }else{
  
              for(let i=0;i&lt;userFound.cities.length;i++){
  
                  City.findOne({'city':userFound.cities[i]},function(err,citiesFound){
                      if(err){
                          console.log(err)
                      }else{
                          userFound.citiesPopulate.push(citiesFound.coords);
                          console.log(userFound)
                      }
                  })
              } 
  
          }
      })
  }
  </code></pre>
  
  <p>And, once all the info of every single city has been added to userFound.citiesPopulate (by now just arrays with a pair of coordinates), I want to use <em>res.status(200).send({userFound})</em> to see the result on my postman console, something like this(three cities and three pairs of coordinates):</p>
  
  <pre><code>{ cities: [ 'Bilbao', 'Madrid', 'Barcelona' ],
    citiesPopulate: [ [ -3.68, 40.4 ], [ -2.97, 43.25 ], [ 2.18, 41.38 ] ],
    _id: 5c82c2e5cfa8d543d0133dd6,
    name: 'pruebas35',
    surname: 'pruebas35',
    userName: 'pruebas35',
    email: 'pruebas35@prueba.es',
    password: '$2a$10$eSue5gw7r4dFPtwD8qzJhODcvvNFaRkeQYRAOPO9MCBsy3Djhkffq',
    rol: 'user',
    suscriptionDate: 2019-03-08T19:30:45.075Z,
    __v: 0 }
  </code></pre>
  
  <p>But if I type the <em>res.status</em> into the loop, it is sent and I can´t get the whole information.</p>
  
  <p>I'd like to know a solution for this, please.</p>