yq/pkg/yqlib/operator_split_document.go

15 lines
380 B
Go
Raw Normal View History

2021-01-14 03:25:31 +00:00
package yqlib
func splitDocumentOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
2021-01-14 03:25:31 +00:00
log.Debugf("-- splitDocumentOperator")
var index uint = 0
for el := context.MatchingNodes.Front(); el != nil; el = el.Next() {
2021-01-14 03:25:31 +00:00
candidate := el.Value.(*CandidateNode)
candidate.Document = index
index = index + 1
}
return context, nil
2021-01-14 03:25:31 +00:00
}