Macrobid 100mg while pregnant safe ?

I went to the emergency room last night for some light spotting currently 6 weeks pregnant and they saw a little of bacteria in my urine they prescribed macrobid antibiotics, I’m the type that doesn’t like taking anything during pregnancy but I also don’t want the bacteria to travel up , has anyone taken this med and was fine ?