functionNewSortValidate a sort term whose direction is chosen at run time.ArgumentsReturnsHow it worksFull signatureArgumentsArgumentTypeDescriptionpathPathThe path value.directionDirectionThe direction value.ReturnsThe declared result.(Sort, error)How it worksUse Asc or Desc for a sort written in your code.Full signaturefunc NewSort( path Path, direction Direction, ) (Sort, error)Source query/controls.go:32Related typesPathAn immutable, validated document field path.DirectionA sort direction.SortOne validated ordered field term.