The image shows the basic workflow for using SODA for in-database JavaScript. The image is organized as a flow chart that includes five boxes arranged vertically and connected by arrows, starting from the top. Each box is divided in two parts, the number and name of the step on the left and a corresponding example code element on the right.
import oracledb from "mle-js-oracledb";
const connection = oracledb.defaultConnection();
const db = connection.getSodaDatabase();
const col = db.createCollection("MyJSONCollection");
...
//Create a JSON document
const doc = {
"employee_id": 100,
"job_id": "AD_PRES",
"last_name": "King",
"first_name" "Steven"
...
};
//Insert the document into a collection
col.insertOne(doc);
...
The example code elements correspond to lines included in Example 8-1.