Delete likes related to the current record
160188
public function removeLikes()
	{
		Like::where('likeable_type', $this->morphClass)->where('likeable_id', $this->id)->delete();
		
		LikeCounter::where('likeable_type', $this->morphClass)->where('likeable_id', $this->id)->delete();
	}
37704
def remove(self, user, status=None, symmetrical=False):
        
        if not status:
            status = RelationshipStatus.objects.following()

        res = Relationship.objects.filter(
            from_user=self.instance,
            to_user=user,
            status=status,
            site__pk=settings.SITE_ID
        ).delete()

        if symmetrical:
            return (res, user.relationships.remove(self.instance, status, False))
        else:
            return res
672349
function removeThis()
    {
        $db = eZDB::instance();
        $db->begin();

        // Set all elements using this status to 0 (undefined).
        $statusID = (int)$this->StatusID;
        $db->query( "UPDATE ezorder SET status_id = 0 WHERE status_id = $statusID" );
        $db->query( "UPDATE ezorder_status_history SET status_id = 0 WHERE status_id = $statusID" );

        $id = $this->ID;
        eZPersistentObject::removeObject( eZOrderStatus::definition(), array( "id" => $id ) );

        $db->commit();

        eZOrderStatus::flush();
    }
782172
public function removeStale()
    {
        /** @var \Illuminate\Database\Eloquent\Builder $query */
        $query = $this->importer->getModelInstance()
            ->where('updated_at', '<', $this->now)
            ->orWhereNull('updated_at');

        $this->deleted = $query->count();

        $query->delete();
    }
206109
public void
removeRecord(Record r) {
	Name name = r.getName();
	int rtype = r.getRRsetType();
	synchronized (this) {
		RRset rrset = findRRset(name, rtype);
		if (rrset == null)
			return;
		if (rrset.size() == 1 && rrset.first().equals(r))
			removeRRset(name, rtype);
		else
			rrset.deleteRR(r);
	}
}
617417
def delete(self, name):
    '''
    
    '''
    # TODO: confirm that this does not use the combo index and determine
    # performance implications.
    num_deleted = 0
    for interval,config in self._intervals.items():
      # TODO: use write preference settings if we have them
      num_deleted += self._client[interval].remove( {'name':name} )['n']
    return num_deleted
1196809
def delete(self, cascade=False):
        
        if self.id:
            self.connection.post('delete_playlist', playlist_id=self.id,
                cascade=cascade)
            self.id = None
637547
def remove(self, record):
        """"""
        self._field.validate_value(record)
        del self._elements[record.id]
        self._sync_field()
146909
function removeRecord(options) {
    let query = getQueryParams(options, ['name', 'content', 'type', 'query']);
    return find(options.domain, query).then(function (response) {
      let records = response.data.result;
      if (records.length === 0) {
        throw new Error('No matching records found');
      }
      let results = [];
      _.each(records, function (record) {
        results.push(self.cloudflareClient.removeRecord(record.zone_id, record.id));
      });
      return Promise.all(results);
    }).then(function (responses) {
      let messages = _.map(responses, function (response) {
        return 'Deleted record with id ' + response.data.result.id;
      });

      return new Result(messages);
    });
  }
371031
def delete_item(name)
      previous = items.size
      items.reject! { |item| item.name == name}
      previous != items.size
    end
993639
def delete_saved_aggregation_by_slug(request, slug):
    """"""
    ss = get_object_or_404(Aggregation, slug=slug)
    ss.delete()
    messages.success(request, _("Saved aggregation deleted."))
    return HttpResponseRedirect(
        reverse(
            'djmongo_browse_saved_aggregations_w_params',
            args=(
                ss.database_name,
                ss.collection_name)))
1064215
def delete_record(self, record_id):
        
        self._delete(
            urljoin(self.base_url, "informationobjects/{}".format(record_id)),
            expected_response=204,
        )
        return {"status": "Deleted"}
1346055
def create_deletion_handler(preference):
    
    def delete_related_preferences(sender, instance, *args, **kwargs):
        queryset = preference.registry.preference_model.objects\
                                      .filter(name=preference.name,
                                              section=preference.section)
        related_preferences = queryset.filter(
            raw_value=preference.serializer.serialize(instance))
        related_preferences.delete()
    return delete_related_preferences
165935
function prune() {
		//check if this database is meant to be pruned
		if(~maxAge) {
			var d = new Date();
			d.setDate(d.getDate() - maxAge);

			if(lastChecked < d) { // make sure we're not trying to prune more often than at least maxAge since the last time we did
				mongoose_model.remove()
					.where('updated_at').lt(d)
					.exec(function(error, numAffected) {
						lastChecked = new Date(); //update our lastChecked to reflect our touching the database
						if(error) {
							console.log("Error while removing docs from database", error);
						} else {
							if(options.verbose) {
								console.log("Removed "+numAffected+" old docs from the database.");
							}
						}
					});
			}
		}
	}
917661
def liked_by
      # subquery = Activity.where(activity_object_id: id)
      # people   = Person.joins(activity_object: { actor_activities: :verb })
      #                  .merge(subquery)
      # likers   = people.merge(Verb.by_display_name("like"))
      # unlikers = people.merge(Verb.by_display_name("unlike")).pluck(:id)

      query    = Activity.joins(:verb).with_activity_object_id(id: id)
      likers   = query.merge(Verb.with_display_name(name: "like"))
      unlikers = query.merge(Verb.with_display_name(name: "unlike"))
      people   = likers.map(&:actor)

      unlikers.each do |activity|
        people.delete_at people.index(activity.actor)
      end

      people
    end
196624
def delete_one(self, query):
        
        item = self.find_one(query)
        result = self.table.remove(where(u'_id') == item[u'_id'])

        return DeleteResult(raw_result=result)
808163
def delete(record)
      load
      raise InvalidRecord, "#{record.class} does not have a valid :id!" if record.id.empty?
      @collection.delete record
    end