wix-data: select only specific attributes, how to?

Hi there, i was implementing a http-function where i write a CSV file based on a WixDataQueryResult. With query() i can select the whole data collection and process it. but i don’t want to write the whole collection to the file. so is there an option to either select specific attributes from the collection with query() or to write only specific attributes (columns) to the file (i used the map-function to write the WixDataQueryResult to the file) ? i know that i can filter or match items whose specified property value is within a specified range. but that’s not what i’m looking for.

furthermore, i’m looking to process a JSON in a JSON, e.g. a value of a specified property of the said collection holds another JSON string. I want to process that string or part of that string to a specific data field or data fields (if there are more than 1 items) in the csv file. is there any possibility to do that?

or would it be easier to process the data outside of WIX (e.g. data integration hub) ? if so, what are your experiences with which products? i would look for open source cloud solutions.

thanks in advance & sorry for long post

You can query the whole data and then before you create the file, delete the unneeded fields:

let fieldsToDelete = ["_id", "_createdTime", "boringData"];
query.find().then(r => {
let items = r.items;
for(let i = 0; i < items.length; i++){
for (let j = 0; j < fieldsToDelete.length; j++){
let fieldToDelete = fieldsToDelete[j];
delete items[i][fieldToDelete];
}
}
//create a file
})

nice idea, thx! but i found another solution: i call the http function from another application which i implemented in python. for such things python is a bit more powerful than javascript ^^