private function ensureIndexes()
    {
        if ($this->checkedIndexes) {
            return;
        }

        $this->checkedIndexes = true;

        if ( ! $this->isFilesCollectionEmpty()) {
            return;
        }

        $this->ensureFilesIndex();
        $this->ensureChunksIndex();
    }
private function ensureIndexes()
    {
        if ($this->checkedIndexes) {
            return;
        }

        $this->checkedIndexes = true;

        if ( ! $this->isFilesCollectionEmpty()) {
            return;
        }

        $this->ensureFilesIndex();
        $this->ensureChunksIndex();
    }
private function ensureIndexes ( ) { if ( $ this -> checkedIndexes ) { return ; } $ this -> checkedIndexes = true ; if ( ! $ this -> isFilesCollectionEmpty ( ) ) { return ; } $ this -> ensureFilesIndex ( ) ; $ this -> ensureChunksIndex ( ) ; }
Ensure indexes on the files and chunks collections exist.

This method is called once before the first write operation on a GridFS
bucket. Indexes are only be created if the files collection is empty.
Ensure indexes on the files and chunks collections exist .