Added is_key operator

This commit is contained in:
Mike Farah
2022-09-30 10:27:35 +10:00
parent 3dd5f0c80c
commit 55a7fdfd8a
5 changed files with 90 additions and 0 deletions
+14
View File
@@ -7,6 +7,20 @@ import (
"gopkg.in/yaml.v3"
)
func isKeyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
log.Debugf("-- isKeyOperator")
var results = list.New()
for el := context.MatchingNodes.Front(); el != nil; el = el.Next() {
candidate := el.Value.(*CandidateNode)
results.PushBack(createBooleanCandidate(candidate, candidate.IsMapKey))
}
return context.ChildContext(results), nil
}
func getKeyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
log.Debugf("-- getKeyOperator")