Delete document.

@param string $query
@param array $options
@return boolean
@filter
979078
public function delete($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$params = $query->export($this);
			list($_path, $conditions) = $params['conditions'];
			$data = $query->data();

			if (!empty($data['rev'])) {
				$conditions['rev'] = $data['rev'];
			}
			$result = $this->connection->delete(
				"{$this->_config['database']}/{$_path}",
				$conditions
			);
			$result = json_decode($result);
			$result = (isset($result->ok) && $result->ok === true);

			if ($query->entity()) {
				$query->entity()->sync(null, [], ['dematerialize' => true]);
			}
			return $result;
		});
	}
652114
public function delete($key, array $options = []) {
		return function($params) {
			unset($this->_session[$params['key']]);
			return !isset($this->_session[$params['key']]);
		};
	}
1325076
public function delete($entity, array $options = []) {
		$params = compact('entity', 'options');

		return Filters::run(get_called_class(), __FUNCTION__, $params, function($params) {
			$options = $params + $params['options'] + [
				'model' => get_called_class(),
				'type' => 'delete'
			];
			unset($options['options']);

			$query = static::_instance('query', $options);
			return static::connection()->delete($query, $options);
		});
	}
499520
public function delete($query)
    {
        $resources = $query->getRepository()->getResources();

        foreach ($resources->getLinks() as $link) {
            $query->where($link->child, '=', $link->parent);
        }

        $names = array();

        foreach ($resources as $resource) {
            $query->from($resource->getName().' AS '.$this->_store->quoteName($resource->getAlias()));
            $names[] = $this->_store->quoteName($resource->getAlias());
        }

        $clause = 'DELETE '.implode(', ', $names);

        return $clause;
    }
1032665
public static function doDelete(array $options=array(), $instance=null, $IDField=null) {
		self::prepareQuery($options, $instance, $IDField);
		return self::$instances[$instance]->delete($options);
	}
700708
protected function _delete($query)
    {
        $db = $this->db;
        $sth = $db->prepare($query);
        $response = $sth->execute();

        if ($response) {
            return true;
        }

        return false;
    }
1368512
public function update($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$exportedQuery = $query->export($this);

			if ($exportedQuery['fields'] === null) {
				return true;
			}

			$sql = $this->renderCommand('update', $exportedQuery, $query);
			$result = (boolean) $this->_execute($sql);

			if ($result && is_object($query) && $query->entity()) {
				$query->entity()->sync();
			}
			return $result;
		});
	}
511464
public function findActive(Query $query, array $options)
    {
        return $query->innerJoinWith('Posts', function (Query $q) {
            return $q->find('active');
        })->distinct();
    }
204838
public function update($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$options = $params['options'];
			$params = $query->export($this);

			list($_path, $conditions) = (array) $params['conditions'];
			$data = $query->data();

			foreach (['id', 'rev'] as $key) {
				$data["_{$key}"] = isset($data[$key]) ? (string) $data[$key] : null;
				unset($data[$key]);
			}
			$data = (array) $conditions + array_filter((array) $data);

			$retry = false;
			do {
				$result = $this->connection->put(
					"{$this->_config['database']}/{$_path}",
					$data,
					['type' => 'json']
				);
				$result = is_string($result) ? json_decode($result, true) : $result;
				$retry = $retry ? !$retry : $this->_autoBuild($result);
			} while ($retry);

			if (isset($result['_id']) || (isset($result['ok']) && $result['ok'] === true)) {
				$result = $this->_format($result, $options);
				$query->entity()->sync($result['id'], ['rev' => $result['rev']]);
				return true;
			}
			if (isset($result['error'])) {
				$query->entity()->errors([$result['error']]);
			}
			return false;
		});
	}
34343
protected function doFindAndRemove(array $query, array $options = array())
    {
        $document = parent::doFindAndRemove($query, $options);

        if (isset($document)) {
            // Remove the file data from the chunks collection
            $this->riakCollection->chunks->remove(array('files_id' => $document['_id']), $options);
        }

        return $document;
    }
682300
public function deleteMany($filter, $options = [])
    {
        $filter = $this->castQuery($filter);
        $result = $this->collection->deleteMany($filter, $options);

        if ($result->isAcknowledged()) {
            return true;
        } else {
            return false;
        }
    }
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'];
    }
520943
public function findToken($query, $options)
    {
        return $this->find()->matching('Tokens', function ($q) use ($options) {
            return $q->where(['Tokens.token' => $options['token']]);
        });
    }
481429
public function collect($query, $options = [])
  {
    if (!$this->getNyaa()->canProvideAllData()) {
        return $this->collectRecursive($query, $options);
    }


    return $this->collectSingleFeed($query, $options);
  }
729131
public function send($query = null, array $options = []) {
		$query = !is_object($query) ? new Query((array) $query) : $query;
		$method = $query->method() ?: "get";
		$path = $query->path();
		$data = $query->data();
		$insert = (array) $options + $data + $query->export($this);

		if (preg_match_all('/\{:(\w+)\}/', $path, $matches)) {
			$data = array_diff_key($data,  array_flip($matches[1]));
		}
		return $this->connection->{$method}(
			Text::insert($path, $insert, ['clean' => true]),
			$data + (array) $query->conditions() + ['limit' => $query->limit()],
			(array) $options
		);
	}
802545
public function deleteDocument($collection, $id, array $options = [])
    {
        $this->setOptions($options);
        $doc = new Document($this->client, $this->database, $collection);
        $doc->setHeaders($this->getHeaders());
        $rs = $doc->delete($id);
        $this->checkResponse($rs);
        unset($rs['_curl_info']);

        return $rs;
    }
601623
public function deleteFile(array $options)
    {
        if (!isset($options['FileName'])) {
            $file = $this->getFile($options);

            $options['FileName'] = $file->getName();
        }

        if (!isset($options['FileId']) && isset($options['BucketName']) && isset($options['FileName'])) {
            $file = $this->getFile($options);

            $options['FileId'] = $file->getId();
        }

        try {
            $this->generateAuthenticatedClient([
                'fileName' => $options['FileName'],
                'fileId'   => $options['FileId'],
            ])->request('POST', '/b2_delete_file_version');
        } catch (\Exception $e) {
            return false;
        }

        return true;
    }