Mongolid\Cursor\CursorInterface::sort PHP Method

sort() public method

Sorts the results by given fields.
public sort ( array $fields ) : Mongolid\Cursor\CursorInterface
$fields array An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort.
return Mongolid\Cursor\CursorInterface Returns this cursor.
    public function sort(array $fields);