function

Compare

func Compare( path Path, operator Operator, value Value, ) (Expression, error)

Construct a comparison while returning validation errors.

Source query/expression.go:68

@param path
The path value.
@param operator
The operator value.
@param value
The value value.
@returns
The declared result.

Prefer this form when the operator is dynamic. Convenience comparison functions panic only if called with an incompatible Value kind; with their documented inputs they are safe.

Related types

  • Path

    An immutable, validated document field path.

  • Operator

    The finite comparison vocabulary.

  • Value

    An immutable scalar or list comparison operand.

  • Expression

    A sealed immutable predicate consumed atomically by stores.