Beispiel #1
0
 /**
  * Update one or more items in a collection with the provided data.
  *
  * @param null|array|\Closure $query The query to use to select the items.
  * @param array               $data An array of data presenting the update.
  * @param array               $options An array of options for the process.
  *
  * @return int|bool The number of items updated or false on failure.
  */
 public function update($query, $data, $options = [])
 {
     return $this->peer->update($data, $query, $options);
 }
 /**
  * Finds one file.
  *
  * @param mixed $query  filename or search query
  * @param array $fields metadata fields select/exclude statement
  *
  * @return object|null MongoGridFSFile instance or null when not found.
  */
 public function findOne($query = [], $fields = [])
 {
     if (is_string($query)) {
         return $this->collection->findOne($query, $fields = []);
     }
     return parent::findOne($query, $fields);
 }