Not sure if my N1ql query is correct

The following should work. If number of count on each type grows you need to measure performance impact.

INSERT INTO default VALUES("k001",{ "userName": "bob", "distance": 4, "type": "Type1" }), VALUES("k002",{ "userName": "bob", "height": 5, "type": "Type2" });
CREATE INDEX ix1 ON default(type);
SELECT d.*, t2.*  FROM default d
LET t2 = FIRST v FOR v IN (SELECT RAW d2 FROM default d2 WHERE d2.type = "Type2") WHEN v.userName = d.userName END
WHERE d.type = "Type1" AND t2 IS NOT MISSING;