function _removeAllOfCollection(rxDatabase, collectionName) {
  return rxDatabase.lockedRun(function () {
    return (0, _rxDatabaseInternalStore.getAllDocuments)(rxDatabase.internalStore);
  }).then(function (data) {
    var relevantDocs = data.map(function (row) {
      return row.doc;
    }).filter(function (doc) {
      var name = doc._id.split('-')[0];

      return name === collectionName;
    });
    return Promise.all(relevantDocs.map(function (doc) {
      return rxDatabase.lockedRun(function () {
        return rxDatabase.internalStore.remove(doc);
      });
    })).then(function () {
      return relevantDocs.map(function (doc) {
        return doc.version;
      });
    });
  });
}
/**
 * removes all internal docs of a given collection
 * @return resolves all known collection-versions
 */
removes all internal docs of a given collection
@return resolves all known collection-versions
removes all internal docs of a given collection @return resolves all known collection - versions
function _removeAllOfCollection(rxDatabase, collectionName) {
  return rxDatabase.lockedRun(function () {
    return (0, _rxDatabaseInternalStore.getAllDocuments)(rxDatabase.internalStore);
  }).then(function (data) {
    var relevantDocs = data.map(function (row) {
      return row.doc;
    }).filter(function (doc) {
      var name = doc._id.split('-')[0];
      return name === collectionName;
    });
    return Promise.all(relevantDocs.map(function (doc) {
      return rxDatabase.lockedRun(function () {
        return rxDatabase.internalStore.remove(doc);
      });
    })).then(function () {
      return relevantDocs.map(function (doc) {
        return doc.version;
      });
    });
  });
}
function _removeAllOfCollection ( rxDatabase , collectionName ) { return rxDatabase . lockedRun ( function ( ) { return ( 0 , _rxDatabaseInternalStore . getAllDocuments ) ( rxDatabase . internalStore ) ; } ) . then ( function ( data ) { var relevantDocs = data . map ( function ( row ) { return row . doc ; } ) . filter ( function ( doc ) { var name = doc . _id . split ( '-' ) [ 0 ] ; return name === collectionName ; } ) ; return Promise . all ( relevantDocs . map ( function ( doc ) { return rxDatabase . lockedRun ( function ( ) { return rxDatabase . internalStore . remove ( doc ) ; } ) ; } ) ) . then ( function ( ) { return relevantDocs . map ( function ( doc ) { return doc . version ; } ) ; } ) ; } ) ; }
removes all internal docs of a given collection
 @return resolves all known collection-versions
removes all internal docs of a given collection @return resolves all known collection - versions