Map namespace for one-to-many message transformations.
Map is the most common UDF type, allowing you to transform each input message into zero or more output messages. Use cases include:
import { map } from '@numaproj/numaflow-js';const server = new map.AsyncServer(async (datum) => { const data = JSON.parse(datum.value.toString()); // Filter out invalid data if (!data.valid) { return [map.Message.toDrop()]; } // Transform and return return [new map.Message(Buffer.from(JSON.stringify({ ...data, processed: true })))];});server.start(); Copy
import { map } from '@numaproj/numaflow-js';const server = new map.AsyncServer(async (datum) => { const data = JSON.parse(datum.value.toString()); // Filter out invalid data if (!data.valid) { return [map.Message.toDrop()]; } // Transform and return return [new map.Message(Buffer.from(JSON.stringify({ ...data, processed: true })))];});server.start();
Map namespace for one-to-many message transformations.
Map is the most common UDF type, allowing you to transform each input message into zero or more output messages. Use cases include:
Example