Help us shape the future of Go! Take the 2026 Go Developer Survey

jsonfilter

package
v1.93.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEntSelectorFromJSONFilter

func BuildEntSelectorFromJSONFilter(jsonFilter *JSONFilter) (*entsql.Predicate, error)

BuildEntSelectorFromJSONFilter constructs an Ent SQL predicate for JSON filtering.

Types

type JSONFilter

type JSONFilter struct {
	// Column is the name of the JSON column.
	Column string
	// FieldPath is the path to the field in the JSON object.
	// It's the inner path within the json column. It accepts dot notation.
	// Example:
	// "metadata.name" for {"metadata": {"name": "foo"}}
	FieldPath string
	// Value is the value to compare against.
	Value any
	// Operator is the comparison operator.
	Operator JSONOperator
}

JSONFilter represents a filter for JSON fields.

type JSONOperator

type JSONOperator string

JSONOperator represents supported JSON filter operators.

const (
	OpEQ  JSONOperator = "eq"
	OpNEQ JSONOperator = "neq"
	OpIN  JSONOperator = "in"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL