if docId is empty, we now save a new document.