You are here

public function CacheBackendMongodb::deleteMultiple in MongoDB 8

Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().

Deletes multiple items from the cache.

Parameters

array $cids: An array of cache IDs to delete.

Overrides CacheBackendInterface::deleteMultiple

File

src/CacheBackendMongodb.php, line 227
Definition of Drupal\mongodb/CacheBackendMongodb.

Class

CacheBackendMongodb
Defines MongoDB cache implementation.

Namespace

Drupal\mongodb

Code

public function deleteMultiple(array $cids) {
  try {
    $remove = array(
      'cid' => array(
        '$in' => $cids,
      ),
    );
    $this->collection
      ->remove($remove, array(
      'w' => 0,
    ));
  } catch (\Exception $e) {

    // The database may not be available.
  }
}