batch/db.purge/db.purge.batch.js
function purgeResource(resource, archive) {
        if (!resource.purge) { return true; }

        var criteria = resource.purge();
        var deferred = Q.defer();

        archive.bind(resource.name);
        archive[resource.name].remove(criteria, function (err, results) {
            err ? deferred.reject(err) : deferred.resolve(results);
        });
        return deferred.promise;
    }
function purgeResource(resource, archive) {
        if (!resource.purge) { return true; }

        var criteria = resource.purge();
        var deferred = Q.defer();

        archive.bind(resource.name);
        archive[resource.name].remove(criteria, function (err, results) {
            err ? deferred.reject(err) : deferred.resolve(results);
        });
        return deferred.promise;
    }
function purgeResource ( resource , archive ) { if ( ! resource . purge ) { return true ; } var criteria = resource . purge ( ) ; var deferred = Q . defer ( ) ; archive . bind ( resource . name ) ; archive [ resource . name ] . remove ( criteria , function ( err , results ) { err ? deferred . reject ( err ) : deferred . resolve ( results ) ; } ) ; return deferred . promise ; }
Purge one particular resource
@param resource
@param archive
Purge one particular resource