src/League/Monga/Query/Indexes.php
protected function prepareIndex($index)
    {
        foreach ($index as &$value) {
            // Convert ascending
            $value = $value === 'asc' ? 1 : $value;

            // Convert descending
            $value = $value === 'desc' ? -1 : $value;

            // Convert geo to 2d
            $value = $value === 'geo' ? '2d' : $value;
        }

        return $index;
    }
protected function prepareIndex($index)
    {
        foreach ($index as &$value) {
            // Convert ascending
            $value = $value === 'asc' ? 1 : $value;

            // Convert descending
            $value = $value === 'desc' ? -1 : $value;

            // Convert geo to 2d
            $value = $value === 'geo' ? '2d' : $value;
        }

        return $index;
    }
protected function prepareIndex ( $ index ) { foreach ( $ index as & $ value ) { // Convert ascending $ value = $ value === 'asc' ? 1 : $ value ; // Convert descending $ value = $ value === 'desc' ? - 1 : $ value ; // Convert geo to 2d $ value = $ value === 'geo' ? '2d' : $ value ; } return $ index ; }
Prepate an index, allowing more expressive syntax.

@param object $index index

@return object $index prepared index
Prepate an index allowing more expressive syntax .