Archives (soft delete) all the records matching the query.

        This assumes that the model allows archiving (not many do - especially
        transactional documents).

        Internal implementation sets the active field to False.
769474
def archive(self):
        
        ids = self.rpc_model.search(self.domain, context=self.context)
        if ids:
            self.rpc_model.write(ids, {'active': False})
190002
def editRecords(dbid,fieldValuesToSet,query=nil,qid=nil,qname=nil)
      edited_rids = []
      if fieldValuesToSet and fieldValuesToSet.is_a?(Hash)
         verifyFieldList(fieldValuesToSet.keys,nil,dbid)
         recordIDs = getAllValuesForFields(dbid,["3"],query,qid,qname,"3")
         if recordIDs
            numRecords = recordIDs["3"].length
            (0..(numRecords-1)).each {|i|
               @rid = recordIDs["3"][i]
               setFieldValues(fieldValuesToSet)
               edited_rids << @rid
            }   
         end
      else
         raise "'fieldValuesToSet' must be a Hash of field names and values."
      end
      edited_rids 
   end
605986
def delete(self):
        '''
        

        '''
        versions = self.get_versions()
        self.api.manager.delete_archive_record(self.archive_name)

        for version in versions:
            if self.authority.fs.exists(self.get_version_path(version)):
                self.authority.fs.remove(self.get_version_path(version))

            if self.api.cache:
                if self.api.cache.fs.exists(self.get_version_path(version)):
                    self.api.cache.fs.remove(self.get_version_path(version))

        if self.authority.fs.exists(self.archive_name):
            self.authority.fs.removedir(self.archive_name)

        if self.api.cache:
            if self.api.cache.fs.exists(self.archive_name):
                self.api.cache.fs.removedir(self.archive_name)
1111738
def query_delete(cls, expression=None):
        
        if expression is not None:
            executor = Executor(cls.__database__)
            result = executor.execute(expression)
        else:
            result = cls._query.all_index()

        for hash_id in result:
            cls.load(hash_id, convert_key=False).delete()
311786
def delete_all(self, model_class):
        '''
        '''
        assert hasattr(model_class, '_fields'), 'Not a valid model class'

        table = model_class.__name__.lower()
        with Session() as conn:
            SQL = f'DELETE FROM {table}'
            conn.cursor().execute(SQL)
            conn.commit()
470846
def delete(name, dry_run, verbose):
    """"""
    collection = Collection.query.filter_by(name=name).one()
    if verbose:
        tr = LeftAligned(traverse=AttributeTraversal())
        click.secho(tr(collection), fg='red')
    db.session.delete(collection)
498176
def delete(self):
        
        assert self.query.can_filter(), "Cannot use 'limit' or 'offset' with delete."

        del_query = self._clone()

        # Disable non-supported fields.
        del_query.query.clear_ordering()

        return del_query.query.delete()
1096739
def delete(self):
        
        #validate where clause
        partition_key = [x for x in self.model._primary_keys.values()][0]
        if not any([c.field == partition_key.column_name for c in self._where]):
            raise QueryException("The partition key must be defined on delete queries")

        dq = DeleteStatement(
            self.column_family_name,
            where=self._where,
            timestamp=self._timestamp
        )
        self._execute(dq)
84392
def find(query = {})
      query = query.map { |k, v| [FIELDS[k], v] if FIELDS[k] }.compact.to_h
      resource = query.delete(RESOURCE)
      matches = validate(
        find_all_cached_entries(
          query.reverse_merge(
            authority: @authority, client_id: @client.client_id))
      )
      resource_specific(matches, resource) || refresh_mrrt(matches, resource)
    end
749382
protected function filterRecords()
    {
        if ($this->autoFilter && $this->request->isSearchable()) {
            $this->filtering();
        }

        if (is_callable($this->filterCallback)) {
            call_user_func($this->filterCallback, $this->resolveCallbackParameter());
        }

        $this->columnSearch();
        $this->filteredRecords = $this->isFilterApplied ? $this->filteredCount() : $this->totalRecords;
    }
675999
def deleteRecords( fieldNameToTest = nil, test = nil, fieldValueToTest = nil)
      numRecsDeleted = 0
      if @dbid and @fields and fieldNameToTest and test and fieldValueToTest

         numRecs = _getNumRecords

         if numRecs > "0"

            fieldNameToTestID = lookupFieldIDByName( fieldNameToTest )
            fieldToTest = lookupField( fieldNameToTestID ) if fieldNameToTestID
            fieldType = fieldToTest.attributes[ "field_type" ] if fieldToTest

            if fieldNameToTestID
               (1..numRecs.to_i).each{ |rid|
                  _getRecordInfo( rid.to_s )
                  if @num_fields and @update_id and @field_data_list
                     field_data = lookupFieldData( fieldNameToTestID )
                     if field_data and field_data.is_a?( REXML::Element )
                        valueElement = field_data.elements[ "value" ]
                        value = valueElement.text if valueElement.has_text?
                        value = formatFieldValue( value, fieldType )
                        match = eval( "\"#{value}\" #{test} \"#{fieldValueToTest}\"" ) if value
                        if match
                           if _deleteRecord( rid.to_s )
                              numRecsDeleted += 1
                           end
                        end
                     end
                  end
               }
            end
         end
      elsif @dbid
         numRecsDeleted = _purgeRecords
      end
      numRecsDeleted
   end
1236194
def archive(cls):
    """"""
    req = datastore.BeginTransactionRequest()
    resp = datastore.begin_transaction(req)
    tx = resp.transaction
    req = datastore.RunQueryRequest()
    req.read_options.transaction = tx
    q = req.query
    set_kind(q, kind='Todo')
    add_projection(q, '__key__')
    set_composite_filter(q.filter,
                         datastore.CompositeFilter.AND,
                         set_property_filter(
                             datastore.Filter(),
                             'done', datastore.PropertyFilter.EQUAL, True),
                         set_property_filter(
                             datastore.Filter(),
                             '__key__', datastore.PropertyFilter.HAS_ANCESTOR,
                             default_todo_list.key))
    resp = datastore.run_query(req)
    req = datastore.CommitRequest()
    req.transaction = tx
    for result in resp.batch.entity_results:
      req.mutations.add().delete.CopyFrom(result.entity.key)
    resp = datastore.commit(req)
    return ''
686701
def get_queryset(self):
        ''''''
        if self.action == 'list':
            archived = get_true_false_both(
                self.request.query_params, 'archived', 'false')
            if archived == 'true':
                return self.queryset.filter(archived=True)
            if archived == 'false':
                return self.queryset.filter(archived=False)
        return self.queryset
272385
public function delete()
    {
        $this->exitIfModelNotSet();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
        ];

        // check if the document exists before deleting
        if ($this->connection->existsStatement($params)) {
            return $this->connection->deleteStatement($params);
        }

        return true;
    }
1259867
protected function softDelete()
	{
		$column = $this->model->getDeletedAtColumn();

		return $this->update(array($column => $this->model->freshTimestampString()));
	}
1022909
def all(options = {})
      begin
        response = Api.post("/models/#{id}/records", body: options).parsed_response
        ((view_id = options.delete(:view_id) || options.delete('view_id')).nil? ? response : response['records']).map do |data|
          load data
        end
      rescue MultiJson::DecodeError
      end
    end
1169747
def _run_soft_delete(self):
        
        query = self.new_query().where(self.get_key_name(), self.get_key())

        time = self.fresh_timestamp()
        setattr(self, self.get_deleted_at_column(), time)

        query.update({self.get_deleted_at_column(): self.from_datetime(time)})