You are here

public function MongodbNodeGrantStorage::delete in MongoDB 8

Deletes all node access entries.

Overrides NodeGrantDatabaseStorageInterface::delete

File

mongodb_node/src/MongodbNodeGrantStorage.php, line 237
Contains \Drupal\node\NodeGrantDatabaseStorage.

Class

MongodbNodeGrantStorage
Defines a controller class that handles the node grants system.

Namespace

Drupal\mongodb_node

Code

public function delete() {
  $this->mongo
    ->get('entity.node')
    ->update([
    'grant' => [
      '$exists' => TRUE,
    ],
  ], [
    '$unset' => [
      'grant' => '',
    ],
  ], [
    'multi' => TRUE,
  ]);
}