2021-01-14 03:25:31 +00:00
|
|
|
package yqlib
|
|
|
|
|
2021-02-02 07:17:59 +00:00
|
|
|
func splitDocumentOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
2021-01-14 03:25:31 +00:00
|
|
|
log.Debugf("-- splitDocumentOperator")
|
|
|
|
|
2021-12-20 22:30:08 +00:00
|
|
|
var index uint
|
2021-02-02 07:17:59 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-02-02 07:17:59 +00:00
|
|
|
return context, nil
|
2021-01-14 03:25:31 +00:00
|
|
|
}
|