Destroy a single document by criteria and resolve it, otherwies
reject with a NotFoundError.
490651
function (criteria) {
            var self = this;

            return this.needOne(criteria).then(function (target) {
                return self.destroy(target.id).then(function (documents) {
                    return documents[0];
                });
            });
        }
1137437
def delete_document(project_id, knowledge_base_id, document_id):
    """"""
    import dialogflow_v2beta1 as dialogflow
    client = dialogflow.DocumentsClient()
    document_path = client.document_path(project_id, knowledge_base_id,
                                         document_id)

    response = client.delete_document(document_path)
    print('operation running:\n {}'.format(response.operation))
    print('Waiting for results...')
    print('Done.\n {}'.format(response.result()))
720637
def trigger(self, event, filter=None, update=None, documents=None, ids=None, replacements=None):
        

        if not self.has_trigger(event):
            return

        if documents is not None:
            pass
        elif ids is not None:
            documents = self.find_by_ids(ids, read_use="primary")
        elif filter is not None:
            documents = self.find(filter, read_use="primary")
        else:
            raise Exception("Trigger couldn't filter documents")

        for doc in documents:
            getattr(doc, event)(update=update, replacements=replacements)
621799
def remove(self, spec_or_id, multi=True, *args, **kwargs):
        """"""
        if multi:
            return self.delete_many(spec_or_id)
        return self.delete_one(spec_or_id)
1011055
public static function tearDown()
    {
        $dm = static::$dm;

        if (is_null($dm)) {
            return;
        }

        $documents = [
            'Applications\Entity\Application',
            'Cv\Entity\Cv',
            'Jobs\Entity\Job',
            'Organizations\Entity\Organization',
            'Auth\Entity\User',
            'Jobs\Entity\Category',
            'Auth\Entity\UserImage',
            'Organizations\Entity\OrganizationName',
        ];
        foreach ($documents as $document) {
            try {
                $dm->createQueryBuilder($document)
                    ->remove()
                    ->getQuery()
                    ->execute()
                ;
            } catch (\Exception $e) {
            }
        }
    }
192118
def delete(self):
        
        if self.abstract:
            raise AbstractDocumentException()

        self._api.delete_document(self.id)
        self._id = None

        return True
1283375
def delete(self, criteria=None, _all=False):
        ''' 
        '''
        if isinstance(criteria, self._item_class):
            criteria = {'_id': criteria['_id']}

        if criteria is None and not _all:
            raise RuntimeError('Criteria is not defined')

        SQL = SQLBuilder(self._table, criteria).delete()
        self._cursor.execute(SQL)
1293999
def delete(self):
        """"""

        assert '_id' in self._document, "Can't delete documents without `_id`"

        # Send delete signal
        signal('delete').send(self.__class__, frames=[self])

        # Delete the document
        self.get_collection().delete_one({'_id': self._id})

        # Send deleted signal
        signal('deleted').send(self.__class__, frames=[self])
397540
def destroy(self, request, *args, **kwargs):
        
        obj = self.get_object()
        user = request.user

        if strtobool(request.query_params.get('delete_content', 'false')):
            for entity in obj.entity_set.all():
                if user.has_perm('edit_entity', entity):
                    entity.delete()

            for data in obj.data.all():
                if user.has_perm('edit_data', data):
                    data.delete()

        return super().destroy(request, *args, **kwargs)
1210006
def _deleteObject(self, xref):
        """"""
        if self.isClosed:
            raise ValueError("operation illegal for closed doc")

        return _fitz.Document__deleteObject(self, xref)
239044
def delete(self, **kwargs):
        
        if self.is_valid:
            if '_id' in self._document:
                to_delete = self.find_one({'_id': self._id})

                if to_delete:
                    before = self.before_delete()
                    if before:
                        return before

                    try:
                        self.delete_one({'_id': self._id})

                        self.after_delete()

                        return self._document
                    except PyMongoException as exc:
                        return PyMongoError(
                            error_message=exc.details.get(
                                'errmsg', exc.details.get(
                                    'err', 'PyMongoError.'
                                )
                            ),
                            operation='delete', collection=type(self).__name__,
                            document=self._document,
                        )
                else:
                    return DocumentNotFoundError(type(self).__name__, self._id)
            else:
                return UnidentifiedDocumentError(
                    type(self).__name__, self._document
                )
1138420
@Nonnull
  public T delete(
      @Nonnull DocumentReference documentReference, @Nonnull Precondition precondition) {
    return performDelete(documentReference, precondition);
  }
953584
def clean(self, value):
        
        value = super(MongoEmbedded, self).clean(value)
        return self.document_class(**value)
387
def delete(self, id):
        ''''''
        if not self._item_path:
            raise AttributeError('delete is not available for %s' % self._item_name)
        target = self._item_path % id
        self._redmine.delete(target)
        return None
235040
def remove(self, document_id, namespace, timestamp):
        
        self.solr.delete(id=u(document_id),
                         commit=(self.auto_commit_interval == 0))
53871
void prune(AndCriterion criterion) {
		Set<String> usedLayers = new HashSet<String>();
		Set<String> badLayers = new HashSet<String>();
		criterion.serverLayerIdVisitor(usedLayers);
		findUnmatchedLayers(criterion, usedLayers, badLayers);
		if (usedLayers.isEmpty()) {
			criterion.getCriteria().clear();
		} else if (!badLayers.isEmpty()) {
			removeUnmatchedLayers(criterion, badLayers);
		}
	}
542302
def remove(self, document):
        
        assert '_id' in document, 'Document must have an id'
        self.db.execute("delete from %s where id = ?" % self.name, (document['_id'],))