No need to filter if you join as key value object.
Here is an example.
[{"id":"82a438cf.a9903","type":"inject","z":"30af2d3e.d94ea2","name":"one 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":\"one\",\"distance\":1}","payloadType":"json","x":510,"y":3080,"wires":[["a39d5a69.9f9278"]]},{"id":"a39d5a69.9f9278","type":"join","z":"30af2d3e.d94ea2","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"payload.id","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":670,"y":3140,"wires":[["de0114ea.e25ec8","3c1a10ab.7aa64"]]},{"id":"698bc9c0.2b41a","type":"inject","z":"30af2d3e.d94ea2","name":"one 11","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":\"one\",\"distance\":11}","payloadType":"json","x":520,"y":3120,"wires":[["a39d5a69.9f9278"]]},{"id":"872cca95.1a13d8","type":"inject","z":"30af2d3e.d94ea2","name":"two 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":\"two\",\"distance\":1}","payloadType":"json","x":490,"y":3200,"wires":[["a39d5a69.9f9278"]]},{"id":"c50d97fa.95c89","type":"inject","z":"30af2d3e.d94ea2","name":"two 11","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":\"two\",\"distance\":11}","payloadType":"json","x":500,"y":3240,"wires":[["a39d5a69.9f9278"]]},{"id":"de0114ea.e25ec8","type":"function","z":"30af2d3e.d94ea2","name":"","func":"let bool_output = false;\nObject.values(msg.payload).forEach(obj => {\n if(obj.distance <= 10) bool_output = true;\n})\nmsg.payload = bool_output\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":3140,"wires":[["e8ca4b84.7d78c8","dec0e2d1.68407"]]},{"id":"3c1a10ab.7aa64","type":"debug","z":"30af2d3e.d94ea2","name":"object","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":3060,"wires":[]},{"id":"e8ca4b84.7d78c8","type":"rbe","z":"30af2d3e.d94ea2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":970,"y":3140,"wires":[["845dd144.4a7ea"]]},{"id":"dec0e2d1.68407","type":"debug","z":"30af2d3e.d94ea2","name":"boollean","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":3100,"wires":[]},{"id":"845dd144.4a7ea","type":"debug","z":"30af2d3e.d94ea2","name":"filtered","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":3200,"wires":[]}]