How to Define a Dynamic Array using Velo

So, I have a dataset, and I want to fetch items from that dataset based on certain conditions. And I want to store all the returned values in an array.
For eg: Suppose, I have a dataset called modifiedproducts and I want to fetch name & price for all products that belong to a certain collection, say digital
Now, I am adding newer products to my site everyday. So how can I define that array, so that the size of the array is calculated dynamically based on the number of rows returned.
I can define the columns
let productinfo = {
“items”: [
{
name: " ";
price: 0;
}],
totalprice: 0
}

But how can I say though my code that the number of rows is going to be dynamic.

You don’t need to define an array. A database query returns an object that contains an array of items that match the query. The array as returned by the query is the correct size.