public function addIndex(array $keys, array $options = []) : void
    {
        $this->indexes[] = [
            'keys' => array_map(static function ($value) {
                if ($value === 1 || $value === -1) {
                    return $value;
                }
                if (is_string($value)) {
                    $lower = strtolower($value);
                    if ($lower === 'asc') {
                        return 1;
                    }

                    if ($lower === 'desc') {
                        return -1;
                    }
                }
                return $value;
            }, $keys),
            'options' => $options,
        ];
    }
public function addIndex(array $keys, array $options = []) : void
    {
        $this->indexes[] = [
            'keys' => array_map(static function ($value) {
                if ($value === 1 || $value === -1) {
                    return $value;
                }
                if (is_string($value)) {
                    $lower = strtolower($value);
                    if ($lower === 'asc') {
                        return 1;
                    }

                    if ($lower === 'desc') {
                        return -1;
                    }
                }
                return $value;
            }, $keys),
            'options' => $options,
        ];
    }
public function addIndex ( array $ keys , array $ options = [ ] ) : void { $ this -> indexes [ ] = [ 'keys' => array_map ( static function ( $ value ) { if ( $ value === 1 || $ value === - 1 ) { return $ value ; } if ( is_string ( $ value ) ) { $ lower = strtolower ( $ value ) ; if ( $ lower === 'asc' ) { return 1 ; } if ( $ lower === 'desc' ) { return - 1 ; } } return $ value ; } , $ keys ) , 'options' => $ options , ] ; }
Add a index for this Document.
Add a index for this Document .