DB Native¶
The DB Native block gives you direct access to the database driver using JavaScript. This offers maximum flexibility for complex queries that standard blocks can't handle.
Inputs¶
- Connection: The database integration.
- JS: The JavaScript code to execute. You have access to a
dbQuery(query: string)function. - MongoDB: For MongoDB, you need to call
dbQuery()and it will return the rawdbconnection instance. Please refer to the MongoDB documentation for more information on how to usedbobject.
Logic¶
- The block executes your JS code.
- You can write raw SQL queries using
dbQuery(query: string). - The return value of your code is returned as the block output.