setDocAsUpsert() now returns the Document.
Merge pull request #524 from rayward/fix-setdocasupsert-return

setDocAsUpsert() now returns the Document.