Can now insert and replace documents on the database