Tundra includes a service to remove an item from a list of documents ( com.wm.data.IData[] ): tundra.list.document:drop($list[], $index) .
$list is a list of documents ( com.wm.data.IData[] ) that you want to remove from$index is the index of the array with a zero value for the item to be deleted
The corresponding Java code is as follows:
public static final void drop(IData pipeline) throws ServiceException { IDataCursor cursor = pipeline.getCursor(); try { Object[] list = IDataUtil.getObjectArray(cursor, "$list"); String index = IDataUtil.getString(cursor, "$index"); if (index != null) IDataUtil.put(cursor, "$list", drop(list, index)); } finally { cursor.destroy(); } }
However, I agree with MrJames : the best and easiest approach is to create a new list of documents and add only the elements you want to add to the new list using pub.list:appendToDocumentList (or tundra.list.document:append if you use Tundra ) inside the loop step.
source share