Ordering in Arrays and Set types in C3

#1

The C3 IoT Coursera Lecture “Stored Calculated, Reference, and Collection Fields” states that the different collection field types are “array fields, which make up most of the collection fields, maps, which can get quite complicated with maps of maps and so on, and sets, for when you want ordering in your collection.”
I just want to confirm this behavior. Typically, sets are UNORDERED collections, whereas arrays are ordered.
The lecture seems to indicate that sets should be used for ordered collections.

#2

C3 sets are really just arrays that dedup so there is really no difference from an ordering perspective. From a persistence perspective, arrays are treated similarly to maps. They essentially are persisted like a map with an integer key.

1 Like