Delete the current document using the current data. The document does not have to be loaded.
Use $doc->collection()->remove($criteria) to delete multiple documents.

@throws  MongoException
@return  Mongo_Document
431587
public function delete()
  {
    if( ! isset($this->_object['_id']))
    {
      throw new MongoException('Cannot delete '.get_class($this).' without the _id.');
    }
    $this->before_delete();
    $criteria = array('_id' => $this->_object['_id']);

    if( ! $this->collection()->remove($criteria, array('justOne' => TRUE)))
    {
      throw new MongoException('Failed to delete '.get_class($this));
    }

    $this->clear();
    $this->after_delete();

    return $this;
  }
1253941
function delete()
    {
        if ($this->id <= 0) {
            return false;
        }

        $db = new Db();
        $dlt = $db->query('DELETE FROM articlecontent WHERE article = :id', [':id'=>$this->id]);
        $dlt = $db->query('DELETE FROM article WHERE id = :id', [':id'=>$this->id]);

        return $dlt;
    }
620956
public function delete() {
        $query = new DeleteQuery($this->getTable());
        $query->whereConditionGroup($this->getWhereConditionGroup());
        return $this->connection->exec($query);
    }
1113432
public function delete(array $parameters = []) {
        if (!$this->canAlter()) {
            throw new Exception('Need index, type, and key to delete a document');
        }
        if (!$this->esClient) {
            throw new Exception('Need ElasticSearch client object for ALTER operations');
        }
        $params = [
            'index' => $this->meta['index'],
            'type' => $this->meta['type'],
            'id' => $this->meta['id']] + $parameters;
        $result = $this->esClient->delete($params);
        return $result;
    }
1148648
public function remove($document)
    {
        $data = $this->converter->convertToArray($document, [], ['_id', '_routing']);

        if (!isset($data['_id'])) {
            throw new \LogicException(
                'In order to use remove() method document class must have property with @Id annotation.'
            );
        }

        $type = $this->getMetadataCollector()->getDocumentType(get_class($document));

        $this->bulk('delete', $type, $data);
    }
567612
public function delete($collectionName, $condition, $options = [])
    {
        $batchOptions = [];
        foreach (['bypassDocumentValidation'] as $name) {
            if (isset($options[$name])) {
                $batchOptions[$name] = $options[$name];
                unset($options[$name]);
            }
        }

        $this->document = [];
        $this->addDelete($condition, $options);
        $result = $this->executeBatch($collectionName, $batchOptions);

        return $result['result'];
    }
68091
public function delete()
    {
        $cID = $this->getCollectionID();

        if ($this->isAliasPage()) {
            $this->removeThisAlias();

            return;
        }

        if ($cID < 1 || $cID == static::getHomePageID()) {
            return false;
        }

        $db = Database::connection();

        // run any internal event we have for page deletion
        $pe = new DeletePageEvent($this);
        Events::dispatch('on_page_delete', $pe);

        if (!$pe->proceed()) {
            return false;
        }

        $app = Facade::getFacadeApplication();
        $logger = $app->make('log/factory')->createLogger(Channels::CHANNEL_SITE_ORGANIZATION);
        $logger->notice(t('Page "%s" at path "%s" deleted',
            $this->getCollectionName(),
            $this->getCollectionPath()
        ));

        parent::delete();

        $cID = $this->getCollectionID();

        // Now that all versions are gone, we can delete the collection information
        $q = "delete from PagePaths where cID = '{$cID}'";
        $r = $db->query($q);

        // remove all pages where the pointer is this cID
        $r = $db->executeQuery('select cID from Pages where cPointerID = ?', [$cID]);
        while ($row = $r->fetchRow()) {
            PageStatistics::decrementParents($row['cID']);
            $db->executeQuery('DELETE FROM PagePaths WHERE cID=?', [$row['cID']]);
        }

        // Update cChildren for cParentID
        PageStatistics::decrementParents($cID);

        $db->executeQuery('delete from PagePermissionAssignments where cID = ?', [$cID]);

        $db->executeQuery('delete from Pages where cID = ?', [$cID]);

        $db->executeQuery('delete from MultilingualPageRelations where cID = ?', [$cID]);

        $db->executeQuery('delete from SiblingPageRelations where cID = ?', [$cID]);

        $db->executeQuery('delete from Pages where cPointerID = ?', [$cID]);

        $db->executeQuery('delete from Areas WHERE cID = ?', [$cID]);

        $db->executeQuery('delete from PageSearchIndex where cID = ?', [$cID]);

        $r = $db->executeQuery('select cID from Pages where cParentID = ?', [$cID]);
        if ($r) {
            while ($row = $r->fetchRow()) {
                if ($row['cID'] > 0) {
                    $nc = self::getByID($row['cID']);
                    $nc->delete();
                }
            }
        }

        if (\Core::make('multilingual/detector')->isEnabled()) {
            Section::unregisterPage($this);
        }

        $cache = PageCache::getLibrary();
        $cache->purge($this);
    }
1135192
public function delete($collection = '')
		{
			if (empty($collection)) {
				throw new Exception("No Mongo collection selected to delete from");
			}

			try
			{
				$this->db->{$collection}->remove($this->wheres, array('fsync' => true, 'justOne' => true));

				$this->_clear();

				return true;
			} catch (\MongoCursorException $e) {
				throw new Exception("Delete of data into MongoDB failed: {$e->getMessage()}", $e->getCode());
			}
		}
1046810
public function delete(array $objectIDs) {
        $requests = [];

        foreach ($objectIDs as $objectID) {
            $requests[] = [
                'method' => 'cmdb.object.delete',
                'params' => [
                    'object' => $objectID
                ]
            ];
        }

        $this->api->batchRequest($requests);

        return $this;
    }
1274405
def delete(self) :
        ""
        if self.URL is None :
            raise DeletionError("Can't delete a document that was not saved")
        r = self.connection.session.delete(self.URL)
        data = r.json()

        if (r.status_code != 200 and r.status_code != 202) or 'error' in data :
            raise DeletionError(data['errorMessage'], data)
        self.reset(self.collection)

        self.modified = True
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])
411249
public function delete()
    {
        if ($this->request->isPost()) {
            $recordId = StaticFilter::filter(
                'text',
                $this->request->getPost('id')
            );

            $record = call_user_func_array(
                [$this->getModelName(), 'get'],
                [$recordId]
            );

            if (is_null($record)) {
                $this->addWarningMessage(
                    "The {$this->get('modelSingular')} with the provided key ".
                    "does not exists."
                );
            } else {
                if ($record->delete()) {
                    $this->addSuccessMessage(
                        "The {$this->get('modelSingular')} was successfully " .
                        "deleted."
                    );
                }
            }
        }
        return $this->redirect($this->_basePath .'/'.$this->get('modelPlural'));
    }
6279
public function current()
    {
        $document = $this->getCursor()->current();

        if ($document instanceof ActiveRecord) {
            $documentToArray = $document->toArray();
            $this->entitySchema = $document->getSchema();
        } else {
            $documentToArray = (array) $document;
        }

        return $this->getAssembler()->assemble(
            $documentToArray,
            $this->entitySchema
        );
    }
626273
public function delete()
    {
        $path = $this->model->getPath('destroy');

        return $this->query->from($path)
                ->delete();
    }
1118287
public function deleteEach()
    {
        $objectIterator = $this->fetchIterator();
        $result = [];
        foreach ($objectIterator as $object) {
            $result[] = !$object->delete();
        }
        return $result;
    }
471014
public function delete($id)
    {
        if ($id instanceof Zend_Search_Lucene_Search_QueryHit) {
            /* @var $id Zend_Search_Lucene_Search_QueryHit */
            $id = $id->id;
        }

        if ($id >= $this->_docCount) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Document id is out of the range.');
        }

        $segmentStartId = 0;
        foreach ($this->_segmentInfos as $segmentInfo) {
            if ($segmentStartId + $segmentInfo->count() > $id) {
                break;
            }

            $segmentStartId += $segmentInfo->count();
        }
        $segmentInfo->delete($id - $segmentStartId);

        $this->_hasChanges = true;
    }
356571
public function remove_all_indexes($collection = '')
	{
		if (empty($collection))
		{
			throw new \Mongo_DbException("No Mongo collection specified to remove all indexes from");
		}
		$this->db->{$collection}->deleteIndexes();
		$this->_clear();
		return $this;
	}