bug fix for One-to-many and many-to-many relationships when refering to

the same entity type in existing collections. Bug was found when Fine Stationary was trying to make a collection filtering on an existing collection example: orderitems that have child order items that existing the digital proofs collection. The collection name was Orders - Unassigned Hard and Orders - Unassigned Easy.

also found missing var scope thanks to strict mode