Find right mesh for collider

For my script I need to use a mesh collider. All of my prefabs have a child with Default (Mesh Filter) && Mesh Renderer.
Is there a way to find the right mesh through a script or something else?
I can just find them and drag them but I’m talking about 1500+ prefabs.

For anyone else with this question:

MeshFilter meshFilter = GetComponentInChildren<MeshFilter>();
MeshCollider meshCollider = GetComponent<MeshCollider>();
meshCollider.sharedMesh = meshFilter.mesh;