Documents can now be pushed to the database.

Still need to properly testcase this.