Collections are really just key value pairs of data. Simple as that. And you’re right the Make Glossary mentions collection once and does not define collection.
The definition of bundle is also quite incomplete in the Glossary. A bundle is simply a collection coming out of an output from a module. Bundles drive the number of times a subsequent module is executed.
The idea of converting bundles to arrays with aggregators is not very well understood but is potentially a huge operations saving exercise in terms of how scenarios are designed and built.
The Parse JSON doc defines the difference quite clearly between a collection and an array. The Parse JSON is a deceptively misnamed module – it can be used to generate sample data with a data structure defined or from scratch to test scenario fragments and data manipulation of all sorts.
I like to think of all of this in relation to a table of data in a spreadsheet which many people understand. I think creating a diagram of the relationship between data types, collections and bundles and all the ways they can be structure and manipulated would be a very useful help doc.
- A data type is just string, number, boolean, date or array and they type the values that go into collections
"Peter"
is a string, 1
is a number, true
is a boolean, 2012-12-01T00:00:00Z
is a date and [1,2,"a"]
is an array.
Arrays can have nested arrays too.
- A collection is one or more cells of data (the row/col identifier being the key, and contents of cell being the value). A value of a collection can be an array as well which can nest more collections.
{ "name" : "Peter", "ID" : 1, "MyArray": [1,2,"a"]}
- A bundle is zero or more rows of data in the spreadsheet composed of one or more collections. A bundle is actually an array itself where each element is a collection!
[
{ "name" : "Peter", "ID" : 1, "MyArray": [1,2,"a"]},
{ "name" : "Mike", "ID" : 2 }
]
Here are 2 bundles that can be outputs from a module. All subsequent modules will execute 2 bundles and without any previous path filter will use 2 operations.