You are here

public function MongodbNodeStorage::countDefaultLanguageRevisions in MongoDB 8

Counts the number of revisions in the default language.

Parameters

\Drupal\node\NodeInterface $node: The node entity.

Return value

int The number of revisions in the default language.

Overrides NodeStorageInterface::countDefaultLanguageRevisions

File

mongodb_node/src/MongodbNodeStorage.php, line 73
Contains \Drupal\node\MongodbNodeStorage.

Class

MongodbNodeStorage

Namespace

Drupal\mongodb_node

Code

public function countDefaultLanguageRevisions(NodeInterface $node) {
  return $this->mongo
    ->get('entity_revision.node')
    ->find([
    'values.langcode.0.value' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
  ])
    ->count();
}