Webiny\Component\Mongo\Mongo::findOneAndDelete PHP Method

findOneAndDelete() public method

public findOneAndDelete ( $collectionName, $filter, array $options = [] )
$options array
    public function findOneAndDelete($collectionName, $filter, array $options = [])
    {
        return $this->bridge->findOneAndDelete($this->cName($collectionName), $filter, $options);
    }

Usage Example

Ejemplo n.º 1
0
Archivo: Mongo.php Proyecto: webiny/hrc
 /**
  * Removes the index entry for the given cache key.
  *
  * @param string $key
  *
  * @return bool True if delete was successful, otherwise false.
  */
 public function deleteEntryByKey($key)
 {
     $this->mongoInstance->findOneAndDelete(self::collection, ['key' => $key]);
     return true;
 }