Save a document at the given _id
if the docId is null or empty, then this performs a POST to the database and retrieves a new _id.
Otherwise, a PUT is called.
Either way, a new _id and _rev are retrieved and updated in the Document object
@param doc
@param docId