Passing meconium in utero

Lyanna

Does anyone has experience of baby passing meconium in utero before birth? Looking for some advice if there is anything I can do to prevent it? My first born had thick meconium stained amniotic fluid at the time of delivery ( through c section) and I know it can't be picked up during ultrasound. My doctor says that NST is the only way we would know if there is any distress but still i was hoping there is something i could do for preventing it?

Also does anyone know how early could a baby pass meconium in uterus?