Melatonin

Alma
Has anybody taken melatonin as a sleep aid. I am 27 weeks and having a hard time falling asleep. Is it safe?