collection remove method
        warning:
            if you want to remove all documents,
            you must override _remove_all method to make sure
            you understand the result what you do
423906
def remove(self, filter_=None, **kwargs):
        
        if isinstance(filter_, dict) and filter_ == {}:
            raise ValueError('not allowed remove all documents')

        if filter_ is None:
            raise ValueError('not allowed remove all documents')

        if kwargs.pop('multi', False) is True:
            return self.__collect.delete_many(filter_, **kwargs)
        else:
            return self.__collect.delete_one(filter_, **kwargs)
871683
function removeDuplicates(collection) {
  return collection.filter(function(e, i, arr) {
    return isValue(e) && arr.lastIndexOf(e) === i;
  });
}
299848
public void clear() {
        documentsByEntity.clear();
        deletedEntities.clear();
        documentsById.clear();
        _knownMissingIds.clear();
        if (_countersByDocId != null) {
            _countersByDocId.clear();
        }
    }
305663
void remove_document(Document doc)
    {
        for (Document<K> document : documents_)
        {
            if (document.equals(doc))
            {
                remove_document(doc);
                return;
            }
        }
    }
447447
def removeAll(self):
        
        before_len = len(self.model.db)
        self.model.db = []
        if not self._batch.enable.is_set():
            self.model.save_db()
        return before_len - len(self.model.db)
175418
def clear_document(self):
        
        self._components.clear()
        self._sequences.clear()
        self._namespaces.clear()
        self._models.clear()
        self._modules.clear()
        self._collections.clear()
        self._annotations.clear()
        self._functional_component_store.clear()
        self._collection_store.clear()
267279
def remove_examples_all():
    
    d = examples_all_dir()
    if d.exists():
        log.debug('remove %s', d)
        d.rmtree()
    else:
        log.debug('nothing to remove: %s', d)
367184
def remove(self, cond=None, doc_ids=None, eids=None):
        
        doc_ids = _get_doc_ids(doc_ids, eids)

        if cond is None and doc_ids is None:
            raise RuntimeError('Use purge() to remove all documents')

        return self.process_elements(
            lambda data, doc_id: data.pop(doc_id),
            cond, doc_ids
        )
198835
def clear(self):
        "
        self.bad = False
        self.errors = {}
        self._collection.clear()
383091
function(docs, callback) {
				remaining = docs;
				console.log('[ remove ] info: ' + remaining +' to remove.');
				async.eachLimit(_.range(0, docs, 10000), 1, handleOneBlock, callback);
			}
809647
def remove_all(*classes)
      classes.flatten!
      if classes.empty?
        @deletes += 1
        indexer.remove_all
      else
        @deletes += classes.length
        classes.each { |clazz| indexer.remove_all(clazz) }
      end
    end
1303656
def clear(ctx, schema):
    """"""

    response = _ask('Are you sure you want to delete the collection "%s"' % (
        schema), default='N', data_type='bool')
    if response is True:
        host, port = ctx.obj['dbhost'].split(':')

        client = pymongo.MongoClient(host=host, port=int(port))
        database = client[ctx.obj['dbname']]

        log("Clearing collection for", schema, lvl=warn,
            emitter='MANAGE')
        result = database.drop_collection(schema)
        if not result['ok']:
            log("Could not drop collection:", lvl=error)
            log(result, pretty=True, lvl=error)
        else:
            log("Done")
983512
public void removeAll()
    {
        if (m_aCurrentRecord != null)
        {
            for (int index = m_iCurrentRecordStart; index < m_iCurrentRecordEnd; index++)
            {
                int iArrayIndex = this.bufferToArrayIndex(index);
                Object bookmark = m_aCurrentRecord[iArrayIndex];
                if ((bookmark != null) && (bookmark != gEmptyCell))
                    this.freeElement(bookmark);
                m_aCurrentRecord[iArrayIndex] = gEmptyCell;   // No record here
            }
        }
        m_iCurrentRecordStart = 0;      // The first
        m_iCurrentRecordEnd = 0;        // One after the last (Use array nomenclature)
    }
376836
def delete(self, key):
    '''
    '''
    try:
      del self._collection(key)[key]

      if len(self._collection(key)) == 0:
        del self._items[str(key.path)]
    except KeyError, e:
      pass
1354280
def delete(collection_name, spec, safe,
           last_error_args, opts, flags=0):
    
    data = _ZERO_32
    data += bson._make_c_string(collection_name)
    data += struct.pack("<I", flags)
    encoded = bson.BSON.encode(spec, False, opts)
    data += encoded
    if safe:
        (_, remove_message) = __pack_message(2006, data)
        (request_id, error_message, _) = __last_error(collection_name,
                                                      last_error_args)
        return (request_id, remove_message + error_message, len(encoded))
    else:
        (request_id, remove_message) = __pack_message(2006, data)
        return (request_id, remove_message, len(encoded))
1164063
@Override
	public boolean removeAll(Collection<?> collection) {
		if (booleanTerms == null) {
			return false;
		}
		return booleanTerms.removeAll(collection);
	}
1277131
def delete(collection_name, spec, safe, last_error_args):
    
    data = __ZERO
    data += bson._make_c_string(collection_name)
    data += __ZERO
    data += bson.BSON.encode(spec)
    if safe:
        (_, remove_message) = __pack_message(2006, data)
        (request_id, error_message) = __last_error(last_error_args)
        return (request_id, remove_message + error_message)
    else:
        return __pack_message(2006, data)