UDFs with Arrays

Hello there

You can solve this issue by transforming the array of objects into a simple array of values that FQL functions on.

like this

const orders = Order.all();
const orderIds = orders.map(order => order.orderid);
const maxOrderId = Math.max(…orderIds);
const newOrderId = maxOrderId + 1;

Apply this method. I hope this will be helpful for you.

For more information Remove item from nested array