I would recommend a simple lodash function instead.
data.parts = _.map(data.parts, 'id');
It will return only values from ID as an array.
Also, I would recommend to make these manipulations in a custom controller find()/findOne(), as the lifecycles also affect the Admin UI results.