Update/create references and embeded documents