Update document if not exists?

Thanks!!!
That’s what I want to know!