If your doctor said it was a yeast infection, I'm supposing it's based on some type of analysis, swab, test...etc done to you. And if she said its yeast infection then I would trust on her knowledge and treatment.
The Usual medication for bacterial vaginosis is antibiotics, which has NOTHING to do with the medication for yeast infection, an antifungal.
Third, if you have recurrent yeast infections I'd try to address this issue with the obgyn and ask why is happening instead of just having endless medication to treat the symptoms. It is known that yeast infection lives and thrives on sugar. Maybe you are developing high glucose, or you are simply eating rooming sugary foods. I'd also avoid any "fermentation" process.. That means, bread, soy sauce, wine, beer (obviously not now you're pregnant, but maybe for a future)...
I hope it helps.