Deborah Cohan, a trained gynecologist, can be seen getting down -- dressed in full pre-op gown and colorful protective cap -- with a team of anesthetists and other surgical staff.
By Thursday more than 1.4 million people had viewed the 6-minute video showing them dancing to the Beyonce song "Get Me Bodied," Cohan gyrating energetically with a huge smile on her face.
"Nothing brings me greater joy than catalyzing others to dance, move, be in their bodies," she said in a blog post before the operation at the University of California at San Francisco (UCSF) Medical Center on Tuesday.
In her "Deborah's Healing Journey" blog, posted on the website of non-profit Caring Bridge, she asked people to film or picture themselves dancing to the Beyonce tune, wherever they were.
"Are you with me people?" the Harvard-educated obstetrician-gynecologist at UCSF asked in the post, which had over 100,000 visits, and which also featured a picture of her hugging a tree, dressed only in bra and panties.
Messages of support flooded in, including video clips of office staff Beyonce boogies and one fan twirling a hula hoop.
"So inspiring," wrote one, while another added: "You're such a brave woman. Keep rocking out!"
Cohan herself is recovering well. "I was more nervous about how the flash mob was going to go than how the surgery was going to go," she was quoted by local TV station KTVU after the operation, adding: "I am doing great."