Module
query
github.com/riducms/ridu/query — Build filters, refer to fields by path, sort results, and choose which relationships to load.
Comparisons 11
query.Compare()Construct a comparison while returning validation errors.
query.Equal()Match an equal scalar or null.
query.NotEqual()Exclude an equal scalar or null.
query.In()Match any supplied operand.
query.GreaterThan()Match a string or number above the operand.
query.GreaterThanEqual()Match a string or number at or above the operand.
query.LessThan()Match a string or number below the operand.
query.LessThanEqual()Match a string or number at or below the operand.
query.Contains()Match a string containing the supplied text.
query.Like()Match using the store-supported string pattern operator.
query.Exists()Match documents that have a value for a field, or that have none.
Logical operators 3
query.And()Require every child expression.
query.Or()Require at least one child expression.
query.Not()Negate one expression.
Values 11
type query.ValueAn immutable scalar or list comparison operand.
type query.ValueKindThe query operand discriminant.
query.String()Construct a string query operand.
query.Number()Construct a float64 query operand.
query.Boolean()Construct a bool query operand.
query.Null()Construct a null query operand.
query.List()Construct a defensively copied list operand.
query.DateTime()Convert a time to the text a date-and-time field stores.
interface query.OperandA value that Equal, NotEqual, and In compare with a field.
interface query.OrderedA value that greater-than and less-than comparisons accept.
query.Reference()Construct a polymorphic relationship candidate.
Paths 4
type query.PathAn immutable, validated document field path.
query.NewPath()Validate and build a path from segments computed at run time.
query.ParsePath()Validate a dot-separated path.
interface query.FieldPathA field name in a filter or sort: a string such as "seo.title", or a Path.
Result controls 6
type query.DirectionA sort direction.
type query.SortOne validated ordered field term.
query.Asc()Sort by a field from lowest to highest.
query.Desc()Sort by a field from highest to lowest.
query.NewSort()Validate a sort term whose direction is chosen at run time.
type query.PopulationExpand one relationship path into projected target documents.
Expressions 2
interface query.ExpressionA sealed immutable predicate consumed atomically by stores.
type query.ExpressionKindThe recursive expression shape.
Adapter contracts 3
type query.NodeA detached recursive expression snapshot for stores and transports.
type query.ComparisonOne path/operator/value predicate snapshot.
type query.OperatorThe finite comparison vocabulary.
Constants 24
constant query.AscendingPublic constant Ascending from github.com/riducms/ridu/query.
constant query.DescendingPublic constant Descending from github.com/riducms/ridu/query.
constant query.ExpressionAndPublic constant ExpressionAnd from github.com/riducms/ridu/query.
constant query.ExpressionComparisonPublic constant ExpressionComparison from github.com/riducms/ridu/query.
constant query.ExpressionNotPublic constant ExpressionNot from github.com/riducms/ridu/query.
constant query.ExpressionOrPublic constant ExpressionOr from github.com/riducms/ridu/query.
constant query.MaxPathBytesMaxPathBytes bounds user-supplied filter/sort/population path allocation.
constant query.MaxPathSegmentsMaxPathSegments bounds recursive query compilation and schema traversal. Ridu's operation engine supports substantially shallower authored models, leaving this ceiling as a fail-safe rather than a practical restriction.
constant query.OperatorContainsPublic constant OperatorContains from github.com/riducms/ridu/query.
constant query.OperatorEqualPublic constant OperatorEqual from github.com/riducms/ridu/query.
constant query.OperatorExistsPublic constant OperatorExists from github.com/riducms/ridu/query.
constant query.OperatorGreaterThanPublic constant OperatorGreaterThan from github.com/riducms/ridu/query.
constant query.OperatorGreaterThanEqualPublic constant OperatorGreaterThanEqual from github.com/riducms/ridu/query.
constant query.OperatorInPublic constant OperatorIn from github.com/riducms/ridu/query.
constant query.OperatorLessThanPublic constant OperatorLessThan from github.com/riducms/ridu/query.
constant query.OperatorLessThanEqualPublic constant OperatorLessThanEqual from github.com/riducms/ridu/query.
constant query.OperatorLikePublic constant OperatorLike from github.com/riducms/ridu/query.
constant query.OperatorNotEqualPublic constant OperatorNotEqual from github.com/riducms/ridu/query.
constant query.ValueBooleanPublic constant ValueBoolean from github.com/riducms/ridu/query.
constant query.ValueListPublic constant ValueList from github.com/riducms/ridu/query.
constant query.ValueNullPublic constant ValueNull from github.com/riducms/ridu/query.
constant query.ValueNumberPublic constant ValueNumber from github.com/riducms/ridu/query.
constant query.ValueStringPublic constant ValueString from github.com/riducms/ridu/query.
constant query.ValueReferencePublic constant ValueReference from github.com/riducms/ridu/query.
Methods 14
Functions 1
query.Field()Field names a field by its segments, such as Field("seo", "title"). Like regexp.MustCompile, it panics when a name is malformed. Filter helpers also accept the dot-separated string "seo.title" directly; use Field when you need a Path value, such as for ListOptions.Select.