mongo shell is a fully functioning javascript interpreter code example
Example: mongo shell load
load("scripts/myjstest.js")
load("/data/db/scripts/myjstest.js")
load("scripts/myjstest.js")
load("/data/db/scripts/myjstest.js")