setDocAsUpsert() now returns the Document.