Remove an instance
        
        Remove an object from the MongoDB storage for caching
        
        Args:
            instance (AtlasServiceInstance.Instance): instance
        
        Raises:
            ErrStorageMongoConnection: Error during MongoDB communication.
            ErrStorageRemoveInstance: Failed to remove the instance.

def remove_instance(self, instance):
        """ Remove an instance
        
        Remove an object from the MongoDB storage for caching
        
        Args:
            instance (AtlasServiceInstance.Instance): instance
        
        Raises:
            ErrStorageMongoConnection: Error during MongoDB communication.
            ErrStorageRemoveInstance: Failed to remove the instance.
        """
        
        # query
        query = { "instance_id" : instance.instance_id, "binding_id" : { "$exists" : False } }
        
        # delete the instance
        try:
            result = self.broker.delete_one(query)
        except:
            raise ErrStorageMongoConnection("Remove Instance")
        
        # return the result
        if result is not None and result.deleted_count == 1:
            instance.provisioned = False
        else:
            raise ErrStorageRemoveInstance(instance.instance_id)