function
Compare
Construct a comparison while returning validation errors.
Arguments
Returns
The declared result.
(Expression, error)How it works
Use it when the operator or value comes from input. The comparison helpers such as Equal panic on a malformed name or incompatible value instead.
Full signature
func Compare(
path Path,
operator Operator,
value Value,
) (Expression, error)Related types
PathAn immutable, validated document field path.
OperatorThe finite comparison vocabulary.
ValueAn immutable scalar or list comparison operand.
ExpressionA sealed immutable predicate consumed atomically by stores.