@@ -366,4 +366,40 @@ For example, consider an array of objects named `fruits`.
366
366
]
367
367
` ` `
368
368
369
- The filter `fruits.*.name` returns the array `[ "apple", "orange", "pear" ]`
369
+ The filter `fruits.*.name` returns the array `[ "apple", "orange", "pear" ]`.
370
+
371
+ You may also use the `*` syntax on an object. For example, suppose you have an object named `vegetables`.
372
+
373
+ ` ` ` json
374
+
375
+ {
376
+ "scallions":
377
+ {
378
+ "colors": ["green", "white", "red"],
379
+ "ediblePortions": ["roots", "stalks"],
380
+ },
381
+ "beets":
382
+ {
383
+ "colors": ["purple", "red", "gold", "white", "pink"],
384
+ "ediblePortions": ["roots", "stems", "leaves"],
385
+ },
386
+ "artichokes":
387
+ {
388
+ "colors": ["green", "purple", "red", "black"],
389
+ "ediblePortions": ["hearts", "stems", "leaves"],
390
+ },
391
+ }
392
+ ` ` `
393
+
394
+ The filter `vegetables.*.ediblePortions` could evaluate to :
395
+
396
+ ` ` ` json
397
+
398
+ [
399
+ ["roots", "stalks"],
400
+ ["hearts", "stems", "leaves"],
401
+ ["roots", "stems", "leaves"],
402
+ ]
403
+ ` ` `
404
+
405
+ Since objects don't preserve order, the order of the output can not be guaranteed.
0 commit comments