title: Mongoose QueryStream and Request Module
body: <p>When performing a QueryStream on a Model such as </p>
  
  <pre><code>User.find({}).stream().on('data', (user) =&gt; {
      request.post(someOptions, (error, response, body) =&gt; {
           if(!error &amp;&amp; response.statusCode === 200) {
               user.someProperty = body.newValue;
               user.save((err) =&gt; {
                   if (err) console.log(err)
               });
           } else {
               console.log(error);
               console.log(response);
           }
  }).on('end', () =&gt; {
      console.log('all users have new values');
  });
  </code></pre>
  
  <p>I'm receiving the console output for the end event and then receiving an error:</p>
  
  <pre><code>all users have new values
  TypeError: user.save is not a function
      at Request._callback
  </code></pre>
  
  <p>I'm assuming this means that the request.post function is running one too many times, as I tried to do this without a stream and simply a</p>
  
  <pre><code>.find({} (err, users) =&gt; {
       for(user in users) {
           request.post...
       } 
  });
  </code></pre>
  
  <p>but this was returning a bad status code from the api I'm posting to as <code>request.post()</code> was sending an <code>undefined</code> value in the options I'm passing that I get from the user document, even though all the documents do have defined values. Although, I wasn't receiving a error for save not being a function. </p>
  
  <p>Can anyone shed some light on what's happening? </p>