Dr. Rey almost went under the knife himself ... in a bad way ... when some dude at a Hollywood nightclub pulled out a blade and threatened to stab the reality star ... in front of a TMZ camera.
Rey -- star of "Dr. 90210" -- was leaving the Roxbury nightclub with his wife on Friday night when a man with tattoos began heckling the doc over his cleavage-baring t-shirt.
Rey turns to the camera and says, "That bitch says he hates my outfit." The tattooed man then walks up next to Rey, looks into the camera himself and while smiling says, "I hate his outfit." It seems like a joke ... at first.
Then, Rey says, "F*ck you motherf*cker ... can you back that up?" The man then pulls out a knife and says, "You're goddamn right I can homie, what's up?." It no longer seems like a joke.
Instantly -- a friend of the tatted man rushes in and rips the guy away from Rey ... while the tatted guy calls the doc a "f**got."
After the incident, Rey told our photog he had no idea who the man was.