Skip to content

Commit

Permalink
Support bluesky
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 21, 2024
1 parent 4d16762 commit 95d585c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,11 @@ router.get("/:user/stats/maintainers", function(req, res, next) {
login : { $addToSet: '$_maintainer.login'}, //can be null
orcid : { $addToSet: '$_maintainer.orcid'}, //can be null
mastodon : { $addToSet: '$_maintainer.mastodon'}, //can be null
bluesky : { $addToSet: '$_maintainer.bluesky'}, //can be null
orgs: { $push: { "k": "$_user", "v": true}},
count : { $sum: 1 }
}},
{$set: {orgs: {$arrayToObject: '$orgs'}, orcid: {$first: '$orcid'}, mastodon: {$first: '$mastodon'}, uuid: {$first: '$uuid'}, login: {$first: '$login'}}},
{$set: {orgs: {$arrayToObject: '$orgs'}, orcid: {$first: '$orcid'}, mastodon: {$first: '$mastodon'}, bluesky: {$first: '$bluesky'}, uuid: {$first: '$uuid'}, login: {$first: '$login'}}},
{$group: {
_id : { $ifNull: [ "$login", "$_id" ]},
uuid: { $first: '$uuid'},
Expand All @@ -759,6 +760,7 @@ router.get("/:user/stats/maintainers", function(req, res, next) {
updated: { $max: '$updated'},
name : { $first: '$name'},
orcid : { $addToSet: "$orcid"},
bluesky : { $addToSet: "$bluesky"},
mastodon : { $addToSet: "$mastodon"},
count : { $sum: '$count'},
orgs: {$mergeObjects: '$orgs'}
Expand All @@ -772,6 +774,7 @@ router.get("/:user/stats/maintainers", function(req, res, next) {
name: 1,
count : 1,
orcid: {$first: '$orcid'},
bluesky: {$first: '$bluesky'},
mastodon: {$first: '$mastodon'},
orgs: {$objectToArray: "$orgs"}
}},
Expand Down

0 comments on commit 95d585c

Please sign in to comment.