lib/operations/db_ops.js
function listCollectionsTransforms(databaseName) {
  const matching = `${databaseName}.`;

  return {
    doc: doc => {
      const index = doc.name.indexOf(matching);
      // Remove database name if available
      if (doc.name && index === 0) {
        doc.name = doc.name.substr(index + matching.length);
      }

      return doc;
    }
  };
}
function listCollectionsTransforms(databaseName) {
  const matching = `${databaseName}.`;

  return {
    doc: doc => {
      const index = doc.name.indexOf(matching);
      // Remove database name if available
      if (doc.name && index === 0) {
        doc.name = doc.name.substr(index + matching.length);
      }

      return doc;
    }
  };
}
function listCollectionsTransforms ( databaseName ) { const matching = ` ${ databaseName } ` ; return { doc : doc => { const index = doc . name . indexOf ( matching ) ; // Remove database name if available if ( doc . name && index === 0 ) { doc . name = doc . name . substr ( index + matching . length ) ; } return doc ; } } ; }
Transformation methods for cursor results
Transformation methods for cursor results