Ejemplo n.º 1
0
 /**
  * Removes data from the collection.
  *
  * @param array $condition description of records to remove.
  * @param array $options list of options in format: optionName => optionValue.
  * @return integer|boolean number of updated documents or whether operation was successful.
  * @throws MongoException on failure.
  */
 public function remove(array $condition = [], array $options = [])
 {
     $result = parent::remove($condition, $options);
     $this->tryLastError();
     // MongoGridFS::remove will return even if the remove failed
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * Selects collection with given name.
  * @param string $name collection name.
  * @return Collection collection instance.
  */
 protected function selectCollection($name)
 {
     return Instance::ensure(['class' => Collection::className(), 'mongoCollection' => $this->mongoDb->selectCollection($name), 'connection' => $this->connection]);
 }