original_string: private function createCommandDocument()
      {
          $cmd = [
              'distinct' => $this->collectionName,
              'key' => $this->fieldName,
          ];
  
          if ( ! empty($this->filter)) {
              $cmd['query'] = (object) $this->filter;
          }
  
          if (isset($this->options['collation'])) {
              $cmd['collation'] = (object) $this->options['collation'];
          }
  
          if (isset($this->options['maxTimeMS'])) {
              $cmd['maxTimeMS'] = $this->options['maxTimeMS'];
          }
  
          return $cmd;
      }
code: private function createCommandDocument()
      {
          $cmd = [
              'distinct' => $this->collectionName,
              'key' => $this->fieldName,
          ];
  
          if ( ! empty($this->filter)) {
              $cmd['query'] = (object) $this->filter;
          }
  
          if (isset($this->options['collation'])) {
              $cmd['collation'] = (object) $this->options['collation'];
          }
  
          if (isset($this->options['maxTimeMS'])) {
              $cmd['maxTimeMS'] = $this->options['maxTimeMS'];
          }
  
          return $cmd;
      }
code_tokens: private function createCommandDocument ( ) { $ cmd = [ 'distinct' => $ this -> collectionName , 'key' => $ this -> fieldName , ] ; if ( ! empty ( $ this -> filter ) ) { $ cmd [ 'query' ] = ( object ) $ this -> filter ; } if ( isset ( $ this -> options [ 'collation' ] ) ) { $ cmd [ 'collation' ] = ( object ) $ this -> options [ 'collation' ] ; } if ( isset ( $ this -> options [ 'maxTimeMS' ] ) ) { $ cmd [ 'maxTimeMS' ] = $ this -> options [ 'maxTimeMS' ] ; } return $ cmd ; }
docstring: Create the distinct command document.
  
  @return array
docstring_tokens: Create the distinct command document .