helpers/index.js
function dataToObjects (data) {
  if (!data) return null
  if (data instanceof Array) {
    return data.map(function(doc) { 
      return doc.toObject()
    })
  }
  return data.toObject()
}
function dataToObjects (data) {
  if (!data) return null
  if (data instanceof Array) {
    return data.map(function(doc) { 
      return doc.toObject()
    })
  }
  return data.toObject()
}
function dataToObjects ( data ) { if ( ! data ) return null if ( data instanceof Array ) { return data . map ( function ( doc ) { return doc . toObject ( ) } ) } return data . toObject ( ) }
Convert a document or an array of documents to objects
Convert a document or an array of documents to objects