Skip to content

Commit

Permalink
Update query.go
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-obernberger committed Jun 2, 2022
1 parent c1ae0cf commit 5b33770
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,21 @@ func in(x, y interface{}) (bool, error) {
// notIn checks if x doesn't exists in y e.g: in("id", []int{1,3,5,8})
func notIn(x, y interface{}) (bool, error) {
b, err := in(x, y)
fmt.Printf("x: %s\n", x)
fmt.Printf("y: %s\n", y)
return !b, err
}

// holds checks if x contains y e.g: holds("[1,2,3]", 1)
func holds(x, y interface{}) (bool, error) {
return in(y, x)
b, err := in(y, x)
return b, err
}

// notHolds checks if x doesn't contain y e.g: notHolds("[1,2,3]", 1)
func notHolds(x, y interface{}) (bool, error) {
return notIn(y, x)
b, err := notIn(y, x)
return b, err
}

// lenEq checks if the string/array/list value is equal
Expand Down

0 comments on commit 5b33770

Please sign in to comment.