Closed parmentf closed 9 years ago
When you have an array containing elements of _id and value (no random example, this is what castorjs operators return), you may need to transform them to one object where _ids are property names and values are their values.
_id
value
Ex:
[ { "_id": "2007", "value": 538 }, { "_id": "2008", "value": 577 }, { "_id": "2009", "value": 611 } ]
should be transformed into:
{ "2007": 538, "2008": 377, "2009": 611 }
That way, you can access the 2008 value using getPropertyVar.
2008
getPropertyVar
So, maybe the array2object action should have [ "_id", "value" ] as a default parameter (when the parameter is not an array).
array2object
[ "_id", "value" ]
When you have an array containing elements of
_id
andvalue
(no random example, this is what castorjs operators return), you may need to transform them to one object where_id
s are property names andvalue
s are their values.Ex:
should be transformed into:
That way, you can access the
2008
value usinggetPropertyVar
.So, maybe the
array2object
action should have[ "_id", "value" ]
as a default parameter (when the parameter is not an array).