Groovy web console

subscribe to the feed Subscribe
to this
site

batchmap

Published 6 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
resultBatch = ['return': [['node1': 'value1'], ['node2': 'value2'], ['node3': 'value3'], ['node4': 'value4']]]

resultMapBatch = ['return': [[]]]
resultBatch['return'].each { it -> resultMapBatch['return'][0] = it + resultMapBatch['return'][0] }

println(resultMapBatch)