Cutting out night feedings.

My pediatrician says we need to stop nursing before bed and through the night because he could get cavities. I'm really stressed out over this. Nights are still hard for us and nursing is the only thing that gets him to sleep sometimes.