public static function deleteDocument( $name, $id )
    {
        // Check if a document with the given name exists.
        if ( !isset( self::$documents[$name] ) )
        {
            throw new phpillowNoSuchPropertyException( $name );
        }

        $db = phpillowConnection::getInstance();
        $revision = $db->get( $db->getDatabase() . $id );

        // Only delete the current revision. This should delete all revisions
        // in the database except somebody updates the document between the get
        // and the delete request
        $db->delete( $db->getDatabase() . $id . '?rev=' . $revision->_rev );
    }