Papaya and pineapple to induce labor !

I am 38 weeks pregnant for today , my doc suggested me to eat papaya and pineapple every day from today ? Is it safe for my baby to eat that ? Does that really help in inducing ?