Update database and document