@@ -16,10 +16,18 @@ If the `data_structure` argument is specified to be:
16
16
17
17
- ` "array_of_arrays" ` , the ` data_container ` argument is interpreted as an array
18
18
of arrays, and the ` key_or_index ` argument is interpreted as an index within
19
- the children arrays.
19
+ the children arrays. The ` key_or_index ` argument is required.
20
20
- ` "array_of_objects" ` , the ` data_container ` argument is interpreted as an array
21
21
of objects, and the ` key_or_index ` argument is interpreted as a key within the
22
- children objects.
22
+ children objects. The ` key_or_index ` argument is required.
23
+ - ` "object_of_arrays" ` , the ` data_container ` argument is interpreted as an object
24
+ of arrays, and the ` key_or_index ` argument is interpreted as an index within
25
+ the children arrays (if specified). If the ` key_or_index ` argument is omitted,
26
+ the key of the child array itself is used as a class expression.
27
+ - ` "object_of_objects" ` , the ` data_container ` argument is interpreted as an object
28
+ if objects, and the ` key_or_index ` argument is interpreted as a key within the
29
+ children objects (if specified). If the ` key_or_index ` argument is omitted, the
30
+ key of the child object itself is used as a class expression.
23
31
- ` "auto" ` , the interpretation is automatically detected based on the data
24
32
structure.
25
33
@@ -45,6 +53,46 @@ If the `data_structure` argument is specified to be:
45
53
46
54
{{< CFEngine_include_snippet(classfilterdata_array_of_objects.cf, #\+ begin_src\s+example_output\s* , .* end_src) >}}
47
55
56
+ ** Example (with object of arrays and endogenous key):**
57
+
58
+ ** Policy:**
59
+
60
+ {{< CFEngine_include_snippet(classfilterdata_object_of_arrays_endogenous.cf, #\+ begin_src cfengine3, .* end_src) >}}
61
+
62
+ ** Output:**
63
+
64
+ {{< CFEngine_include_snippet(classfilterdata_object_of_arrays_endogenous.cf, #\+ begin_src\s+example_output\s* , .* end_src) >}}
65
+
66
+ ** Example (with object of objects and endogenous key):**
67
+
68
+ ** Policy:**
69
+
70
+ {{< CFEngine_include_snippet(classfilterdata_object_of_objects_endogenous.cf, #\+ begin_src cfengine3, .* end_src) >}}
71
+
72
+ ** Output:**
73
+
74
+ {{< CFEngine_include_snippet(classfilterdata_object_of_objects_endogenous.cf, #\+ begin_src\s+example_output\s* , .* end_src) >}}
75
+
76
+ ** Example (with object of arrays and exogenous key):**
77
+
78
+ ** Policy:**
79
+
80
+ {{< CFEngine_include_snippet(classfilterdata_object_of_arrays_exogenous.cf, #\+ begin_src cfengine3, .* end_src) >}}
81
+
82
+ ** Output:**
83
+
84
+ {{< CFEngine_include_snippet(classfilterdata_object_of_arrays_exogenous.cf, #\+ begin_src\s+example_output\s* , .* end_src) >}}
85
+
86
+ ** Example (with object of objects and exogenous key):**
87
+
88
+ ** Policy:**
89
+
90
+ {{< CFEngine_include_snippet(classfilterdata_object_of_objects_exogenous.cf, #\+ begin_src cfengine3, .* end_src) >}}
91
+
92
+ ** Output:**
93
+
94
+ {{< CFEngine_include_snippet(classfilterdata_object_of_objects_exogenous.cf, #\+ begin_src\s+example_output\s* , .* end_src) >}}
95
+
48
96
** Notes:**
49
97
50
98
This function can accept many types of data parameters _ (See [ collecting function] [ Functions#collecting functions ] )_ .
0 commit comments