Remove a collection
        Given a collection_id, branch and optionally an
        author, remove a collection on the given branch
        and attribute the commit to author.
        Returns the SHA of the commit on branch.
355440
def remove_collection(self, first_arg, sec_arg, third_arg, fourth_arg=None, commit_msg=None):
        
        if fourth_arg is None:
            collection_id, branch_name, author = first_arg, sec_arg, third_arg
            gh_user = branch_name.split('_collection_')[0]
            parent_sha = self.get_master_sha()
        else:
            gh_user, collection_id, parent_sha, author = first_arg, sec_arg, third_arg, fourth_arg
        if commit_msg is None:
            commit_msg = "Delete Collection '%s' via OpenTree API" % collection_id
        return self._remove_document(gh_user, collection_id, parent_sha, author, commit_msg)
440878
def remove_record(self, record):
        
        assert self.has_record(record)

        record['_oai']['sets'] = [
            s for s in record['_oai']['sets'] if s != self.spec]
1028322
def delete(self, _id):
        
        mongo_response = yield self.collection.remove({"_id": ObjectId(_id)})

        raise Return(mongo_response)
961800
def remove_role(self, databaseName, roleName, collectionName=None):
        
        role = {"databaseName" : databaseName,
                "roleName" : roleName}
        
        if collectionName:
            role["collectionName"] = collectionName
        
        if role in self.roles:
            self.roles.remove(role)
400680
def remove(self, obj, commit=True):
        
        database = self._database(writable=True)
        database.delete_document(TERM_PREFIXES[ID] + get_identifier(obj))
        database.close()
326937
@Delete("/projects/{projectName}")
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<Void> removeProject(Project project, Author author) {
        // Metadata must be updated first because it cannot be updated if the project is removed.
        return mds.removeProject(author, project.name())
                  .thenCompose(unused -> execute(Command.removeProject(author, project.name())))
                  .handle(HttpApiUtil::throwUnsafelyIfNonNull);
    }
155500
def remove_dataset_from_collection(dataset_id, collection_id, **kwargs):
    
    collection_i = _get_collection(collection_id)
    collection_item = _get_collection_item(collection_id, dataset_id)
    if collection_item is None:
        raise HydraError("Dataset %s is not in collection %s.",
                                                    dataset_id,
                                                    collection_id)
    db.DBSession.delete(collection_item)
    db.DBSession.flush()

    db.DBSession.expunge_all()

    return 'OK'
480852
function removeOthers(mongoose, model, retainedNames) {
    //console.log('here collectionname' + Object.keys(model));
    //console.log('here collectionname' + model.collectionname);
    return model.aggregate({ $project: { modelname: 1 } }).then((r) => r.map(o => o.modelname)).then((modelnames) => {
        debuglog(" present models " + modelnames.length + ' ' + modelnames);
        var delta = _.difference(modelnames, retainedNames);
        debuglog(' spurious models' + delta.length + ' ' + delta);
        if (delta.length === 0) {
            return Promise.resolve(true);
        }
        return Promise.all(delta.map(modelname => model.remove({ modelname: modelname })));
    });
}
994480
def delete_collection(self, collection):
        
        uri = str.join('/', [self.uri, collection])
        return self.service._delete(uri)
1055532
def update_existing_collection(self,
                                   owner_id,
                                   collection_id=None,
                                   json_repr=None,
                                   auth_info=None,
                                   parent_sha=None,
                                   merged_sha=None,
                                   commit_msg=''):
        """"""
        collection = self._coerce_json_to_collection(json_repr)
        if collection is None:
            msg = "File failed to parse as JSON:\n{j}".format(j=json_repr)
            raise ValueError(msg)
        if not self._is_valid_collection_json(collection):
            msg = "JSON is not a valid collection:\n{j}".format(j=json_repr)
            raise ValueError(msg)
        if not collection_id:
            raise ValueError("Collection id not provided (or invalid)")
        if not self.has_doc(collection_id):
            msg = "Unexpected collection id '{}' (expected an existing id!)".format(collection_id)
            raise ValueError(msg)
        # pass the id and collection JSON to a proper git action
        r = None
        try:
            # remove any 'url' field before saving; it will be restored when the doc is fetched (via API)
            if 'url' in collection:
                del collection['url']
            # keep it simple (collection is already validated! no annotations needed!)
            r = self.commit_and_try_merge2master(file_content=collection,
                                                 doc_id=collection_id,
                                                 auth_info=auth_info,
                                                 parent_sha=parent_sha,
                                                 commit_msg=commit_msg,
                                                 merged_sha=merged_sha)
            # identify shard for this id!?
        except:
            raise
        return r
333120
def remove(self):
        
        ''' 
            
        '''
    
        title = '%s.remove' % self.__class__.__name__
    
    # request bucket delete 
        self.s3.delete_bucket(self.bucket_name)

    # return confirmation
        exit_msg = '%s collection has been removed from S3.' % self.bucket_name
        return exit_msg
1227645
def delete_branch(self, project, repository, name, end_point):
        

        url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branches'.format(project=project,
                                                                                            repository=repository)

        data = {"name": str(name), "endPoint": str(end_point)}
        return self.delete(url, data=data)
67535
def delete(
        collection_name, spec, safe, last_error_args, opts, flags=0, ctx=None):
    
    if ctx:
        return _delete_compressed(collection_name, spec, opts, flags, ctx)
    return _delete_uncompressed(
        collection_name, spec, safe, last_error_args, opts, flags)
706996
@Override
  public <T> List<T> findAllAndRemove(String jxQuery, String collectionName) {
    CollectionMetaData cmd = cmdMap.get(collectionName);
    @SuppressWarnings("unchecked")
    Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    if((null == cmd) || (null == collection)) {
      throw new InvalidJsonDbApiUsageException("Collection by name '" + collectionName + "' not found. Create collection first.");
    }
    cmd.getCollectionLock().writeLock().lock();
    try {
      JXPathContext context = contextsRef.get().get(collectionName);
      @SuppressWarnings("unchecked")
      Iterator<T> resultItr = context.iterate(jxQuery);
      Set<Object> removeIds = new HashSet<Object>();
      while (resultItr.hasNext()) {
        T objectToRemove = resultItr.next();
        Object idToRemove = Util.getIdForEntity(objectToRemove, cmd.getIdAnnotatedFieldGetterMethod());
        removeIds.add(idToRemove);
      }

      if(removeIds.size() < 1) {
        return null;
      }

      JsonWriter jw;
      try {
        jw = new JsonWriter(dbConfig, cmd, collectionName, fileObjectsRef.get().get(collectionName));
      } catch (IOException ioe) {
        logger.error("Failed to obtain writer for " + collectionName, ioe);
        throw new JsonDBException("Failed to save " + collectionName, ioe);
      }
      boolean substractResult = jw.removeFromJsonFile(collection, removeIds);

      List<T> removedObjects = null;
      if(substractResult) {
        removedObjects = new ArrayList<T>();
        for (Object id : removeIds) {
          // Don't need to clone it, this object no more exists in the collection
          removedObjects.add(collection.remove(id));
        }
      }
      return removedObjects;

    } finally {
      cmd.getCollectionLock().writeLock().unlock();
    }
  }
1339105
def removeFromCollection(objs)
      method = 'removeFromCollection'
      type = Boolean
      args = {:keys=>Rdio::keys(objs)}
      return_object type,method,args
    end
1199656
def destroy_branch(base_branch, sha)
        if base_branch == "maximus_#{sha}"
          @g.branch('master').checkout
        else
          @g.branch(base_branch).checkout
        end
        @g.branch("maximus_#{sha}").delete
      end
369736
public void delete(Collection collection) {
        pm.currentTransaction().begin();
        pm.deletePersistentAll(collection);
        pm.currentTransaction().commit();
    }