Diagram
  • Introduction
  • Get Started
    • Hello World
    • Connecting to a DB
    • From a template
  • Concepts
    • Endpoints
    • Algorithm
  • Nodes
    • Bcrypt
    • Code
    • Constant
    • Database
    • EasyDB
    • Firestore
    • If / Then
    • Request
    • Response
    • JWT
    • Mapper
    • MongoDB
    • Stripe
    • Webhook
  • Templates
    • Login
    • Register
    • Get User
  • Resources
    • Dashboard
    • Contact
    • FAQs
Powered by GitBook
On this page
  • General
  • Input
  • Output
  • Use Cases

Was this helpful?

  1. Nodes

Mapper

PreviousJWTNextMongoDB

Last updated 3 years ago

Was this helpful?

General

The Mapper node can be used to easily map from one data type to another. All functionality of this node can also be done with link mapping.

For more complex transformation the Code node can be used.

Input

  • Source: Receives an Object or a value type eg. String, Number or Boolean with the values to map. Learn more on .

Examples:

  • Object ➡ Object

"bar.foo": "baz" & {"baz": {"foo": "*value*"}} ➡ {"baz": "*value*"}`

  • Object ➡ Value

"foo[0].bar" & {"foo": [{"bar: *value*"}]} ➡ *value*

  • Value ➡ Object

*value* & "foo[0].bar" ➡ {"foo": [{"bar: *value*"}]}

Output

  • Out: Returns an Object or a value type eg. String, Number or Boolean with the mapped values. Learn more on .

Use Cases

Register a user to a database.

  • Request (Post) ➡ Mapper (Get) ➡ Response (200)

object-mapper
object-mapper