Please publish real JSON documents that we can cut-n-paste into our systems for us to experiment.
Also share what you have tried and indicate how it fails to produce the expected result. This will save us time by preventing us investigating in the wrong directory.
What field from Doc-A refers to Doc-B1? I suspect the y1, y2, y3 from Doc-A to match Doc-B1.name?
Have you tried the trivial $lookupfrom:B that uses localField:x and foreignField:name?