Quick question on collision groups

Hi guys, I'm aware of being able to use collision groups to make certain bodies not collide with other bodies in the same group
In effect this means you can choose what NOT to collide with by setting all things with the same groupIndex parameter.
Is there where a way to force an object to not collide with anything except what you specify. Sort of the reverse of the groupIndex parameter?

Thanks for your time 🙂
ok ignore me, I found the solution to use the maskBits and categoryBits variables aswell as the collisionGroups to create the effect I needed, thanks all

Original thread: https://box2d.org/forum/viewtopic.php?t=512