You are here

public function MongodbNodeGrantStorage::count in MongoDB 8

Counts available node grants.

Return value

int Returns the amount of node grants.

Overrides NodeGrantDatabaseStorageInterface::count

File

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

Class

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

Namespace

Drupal\mongodb_node

Code

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