title: How to convert Mongodb collection results into Array?
body: <p>I want to send my MongoDB collection results to a service -( Algolia to be precise)  as an array. </p>
  
  <p>The results MongoDB return are not array in format. So am thinking if there is a way to convert the collection result into an array.</p>
  
  <p>This is what it returns:</p>
  
  <pre><code>{ _id: 5b30c318ca1ea60cb8a55d2f,
    memeid: 'Z3Q7NC',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529922328/test/adam-levine_nxqpnt.gif',
    tags: 'laugh,laughing,laughing uncontrollaby ',
    caption: '',
    imgs: 'adam-levine.gif',
    __v: 0,
    uploadDate: 2018-06-25T10:25:28.940Z,
    tagarray: [ 'laugh', 'laughing', 'laughinguncontrollaby' ],
    views: 500 }
  { _id: 5b30c759ca1ea60cb8a55d30,
    memeid: '2oIjDP',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529923417/test/Debffc4XkAAuvLj_mvzvpz.jpg'
    tags: 'zuma',
    caption: '',
    imgs: 'Debffc4XkAAuvLj.jpg',
    __v: 0,
    uploadDate: 2018-06-25T10:43:37.859Z,
    tagarray: [ 'zuma' ],
    views: 2000 }
  { _id: 5b30d4b22904771be030db62,
    memeid: 'eLT1F',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529926834/test/crying_b6fjaf.gif',
    tags: 'laugh',
    caption: '',
    imgs: 'crying.gif',
    __v: 0,
    uploadDate: 2018-06-25T11:40:34.649Z,
    tagarray: [ 'laugh' ],
    views: 0 }
  </code></pre>
  
  <p>What am expecting:</p>
  
  <pre><code>[
  { _id: 5b30c318ca1ea60cb8a55d2f,
    memeid: 'Z3Q7NC',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529922328/test/adam-levine_nxqpnt.gif',
    tags: 'laugh,laughing,laughing uncontrollaby ',
    caption: '',
    imgs: 'adam-levine.gif',
    __v: 0,
    uploadDate: 2018-06-25T10:25:28.940Z,
    tagarray: [ 'laugh', 'laughing', 'laughinguncontrollaby' ],
    views: 500 }
  { _id: 5b30c759ca1ea60cb8a55d30,
    memeid: '2oIjDP',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529923417/test/Debffc4XkAAuvLj_mvzvpz.jpg'
    tags: 'zuma',
    caption: '',
    imgs: 'Debffc4XkAAuvLj.jpg',
    __v: 0,
    uploadDate: 2018-06-25T10:43:37.859Z,
    tagarray: [ 'zuma' ],
    views: 2000 }
  { _id: 5b30d4b22904771be030db62,
    memeid: 'eLT1F',
    url: 'http://res.cloudinary.com/memeafrica/image/upload/v1529926834/test/crying_b6fjaf.gif',
    tags: 'laugh',
    caption: '',
    imgs: 'crying.gif',
    __v: 0,
    uploadDate: 2018-06-25T11:40:34.649Z,
    tagarray: [ 'laugh' ],
    views: 0 }
  ]
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>meme.find({}, (err, meme) =&gt; {
    meme.forEach((meme) =&gt; {
      console.log(meme); 
    });
  });
  </code></pre>
  
  <p>How do I manipulate the process so it can be array?</p>
  
  <p>Thanks!</p>