Closed alexmasselot closed 9 years ago
there are a lot of thing not available yet, so the query is approximative. No searchId and no sequenceSource at the protinInfo level
But the idea is a pipeline like: db.psm.aggregate([ {$match:{spSource:'20141212_Fusco_7188B'}}, //that should be searchId {$project:{'proteinList.AC':1, spSource:1, _id:0}}, //that should have proteinRef {$unwind:'$proteinList'}, {$group:{_id:'$spSource', accessionCodes:{$addToSet: "$proteinList.AC"}}} ])
The adapted mongo command is:
db.psm.aggregate([
{$match:{searchId:'M_100'}},
{$project:{'proteinList.proteinRef.AC':1, searchId:1, _id:0}},
{$unwind:'$proteinList'},
{$group:{_id:'$searchId', accessionCodes:{$addToSet: "$proteinList.proteinRef.AC"}}}
])
aggregate. the exact syntaxt will change soon