src/AbstractQueue.php
final public function ensureCountIndex(array $fields, bool $includeRunning)
    {
        $completeFields = [];

        if ($includeRunning) {
            $completeFields['earliestGet'] = 1;
        }

        $this->verifySort($fields, 'fields', $completeFields);

        $this->ensureIndex($completeFields);
    }
final public function ensureCountIndex(array $fields, bool $includeRunning)
    {
        $completeFields = [];

        if ($includeRunning) {
            $completeFields['earliestGet'] = 1;
        }

        $this->verifySort($fields, 'fields', $completeFields);

        $this->ensureIndex($completeFields);
    }
Ensure an index for the count() method.
Is a no-op if the generated index is a prefix of an existing one. If you have a similar ensureGetIndex call,
call it first.

@param array $fields fields in count() call to index in same format as \MongoDB\Collection::createIndex()
@param bool $includeRunning whether to include the running field in the index

@return void

@throws \InvalidArgumentException key in $fields was not a string
@throws \InvalidArgumentException value of $fields is not 1 or -1 for ascending and descending