Skip to content

Commit

Permalink
Simple dump api
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 2, 2024
1 parent 376cdc8 commit 217ad75
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions routes/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ router.get('/shared/mongostatus', function(req, res, next) {
});
});

router.get('/shared/dump', function(req, res, next) {
var cursor = packages.aggregate([
{$match: query},
{$group : {
_id : {'Package': '$Package', 'user':'$_user'},
files: { '$push': '$$ROOT' }
}}
]);
req.query.stream = true;
return send_results(cursor, req, res, next, (x) => group_package_data(x.files));
});

function find_cran_package(pkgname, type = 'src'){
var pkgname = pkgname.toLowerCase();
return packages.findOne({_nocasepkg : pkgname, _type : type, _user : 'cran'}).then(function(x){
Expand Down

0 comments on commit 217ad75

Please sign in to comment.