I have two schemas A and B
A has structure like
{
_id:"5ff4c9862a1c24022aed7899",
steps:[
{id:"5ff149596e5e2358e5af007f",name:"step1"},
{id:"5fedc8560eca62001142c89b",name:"step2"},
]
}
B has structure like
{
_id:"5ff2e7928b597bc948a23c14",
steps_id:"5ff149596e5e2358e5af007f",
A_id:"5ff4c9862a1c24022aed7899"
}
I want to use aggregate query to get B with appropriate step_id.
One thing I did was use $lookup and then use subsequent pipeline to match and get my step but I was wondering if there a more elegant way of doing it
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…