title: export via mongoose streams to node-csv
body: <p>trying to get a CSV dump of some data (~500Mb) in mongodb. Thought streams would be the way to go, to avoid building up an array in memory and then building the csv at once.</p>
  
  <p>But, it seems the stream that mongoose creates and the one that csv expects are not the same thing.</p>
  
  <pre><code> var stream = Subscriber.find().stream()                                                                                                   
   stream.setEncoding = function() { }                                                                                                       
  
  
   csv().from.stream(stream).on('record', function(record, index) {                                                                          
       console.log(record)                                                                                                                   
       console.log(index)                                                                                                                    
   })
  </code></pre>
  
  <p>without the <code>setEncoding()</code> stub above, I get an error about that when csv calls setEncoding on the stream. With it, results in </p>
  
  <pre><code>TypeError: Object #&lt;Object&gt; has no method 'indexOf'
      at [object Object].stringify   (/home/project/node_modules/csv/lib/stringifier.js:98:35)
  </code></pre>
  
  <p>So, is this even the right approach? if so, what is the problem with the streams?</p>