Skip to content

Commit 8a4fc22

Browse files
committed
change: remove HandleCompareOperatorMustNotExists and use negation of HandleCompareOperatorExists instead
1 parent 49a3a91 commit 8a4fc22

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

pkg/openSearch/osquery/boolQueryBuilder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func defaultCompareOperators() []CompareOperator {
291291
},
292292
{
293293
Operator: filter.CompareOperatorMustNotExists,
294-
Handler: HandleCompareOperatorMustNotExists, MustCondition: true,
294+
Handler: HandleCompareOperatorExists, MustCondition: false,
295295
},
296296
}
297297
}

pkg/openSearch/osquery/compareHandler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ func HandleCompareOperatorExists(fieldName string, _ any) (esquery.Mappable, err
158158
return esquery.Exists(fieldName), nil
159159
}
160160

161-
func HandleCompareOperatorMustNotExists(fieldName string, _ any) (esquery.Mappable, error) {
162-
return esquery.Bool().MustNot(esquery.Exists(fieldName)), nil
163-
}
164-
165161
// HandleCompareOperatorBetweenDates constructs an OpenSearch range query for a given date field.
166162
// It accepts a field name and a field value, which must be a slice of exactly 2 elements, representing the start and end of range. Accepted slice types:
167163
// - []time.Time,

0 commit comments

Comments
 (0)