I have 3 collections:
- Plan
- Business Process
- Recovery Strategy
The three of them store their Primary Key in _id and
I have another collection: planRecoveryStrategy which stores
planIdbusinessProcessIdrecoveryStrategyId
Example documents stored in planRecoveryStrategy:
{ "planId" : "PLN1",
"processId" : "PCS1",
"strategyId" : "RES1"
}
{ "planId" : "PLN1",
"processId" : "PCS2",
"strategyId" : "RES1"
}
{ "planId" : "PLN1",
"processId" : "PCS2",
"strategyId" : "RES2"
}
What is the query to write to get given the planId is 'PCS1'
{ "planId" : "PLN1",
"processes" : [{
"processId":"PCS1",
"processData":{<data from Business Process Dictionary for PCS1>},
"strategies":[{<data from Recovery Strategy Dictionary for RES1>}]
},
{
"processId":"PCS2",
"processData":{<data from Business Process Dictionary for PCS1>},
"strategies":[{<data from Recovery Strategy Dictionary for RES1>},
{<data from Recovery Strategy Dictionary for RES2>}]
}]
}
from planRecoveryStrategy?