?
MapperConfig
TypeThe config defineMapper takes: a single map function, one object in and an outcome out.
The config defineMapper takes: a single map function, one raw object in and an outcome out. Everything else about a mapper, its versioning, testing, and deployment, is handled by the platform and the CLI.
MapperConfig.ts
interface MapperConfig {
map: (object: MapObject) => MaybePromise<MapOutcome>
}Fields
map
(object: MapObject) => MapOutcome
One raw object in, an outcome out. Throwing is the object's error outcome.
The config
defineMapper(Archive, {
async map(object) { return documents([toDoc(await object.json())]); },
});