functionNewSortfunc NewSort( path Path, direction Direction, ) (Sort, error)Validate a path and asc/desc direction.Source query/controls.go:20@param pathThe path value.@param directionThe direction value.@returnsThe declared result.Related typesPathAn immutable, validated document field path.DirectionA sort direction.SortOne validated ordered field term.