-
-
Notifications
You must be signed in to change notification settings - Fork 28
MongoDB Queries
Mark Robinson edited this page Aug 9, 2017
·
5 revisions
This is a page to design MongoDB queries for common-workflow-language/cwlviewer#117
Gets, where retrievedFrom.repoUrl and retrievedFrom.path are the same, the last instance of a workflow (random, no real defined order)
db.workflow.aggregate(
[
{
$group: {
_id: {"retrievedFrom.repoUrl": "$retrievedFrom.repoUrl", "retrievedFrom.path": "$retrievedFrom.path"},
workflow: { '$last': '$$ROOT' },
versions: { '$addToSet': '$retrievedFrom.branch' }
}
}
]
)
TODO: Brainstorm criteria for which 'main' version to use, e.g. default to 'master' if it exists, otherwise a branch name over a commit ID etc