If subquery collection has a different unique key field name (let's say foo_id is different to id in primary collection), you've got NullPoniterException from QueryComponent.mergeIds(). To accommodate the difference between uniqueKey field names between collections, add the following parameters foo.fl=id:foo_id&foo.distrib.singlePass=true. The former one renames uniqueKey field, the later switches to single pass search. There is no way to rename field in default processing.
In a rare case when a collection under subquery has no unqueKey at all, it leads to something like "undefined field", but it's not going to work anyway.