I use mongo and script files as follows:
$ mongo getSimilar.js
I would like to pass an argument to the file:
$ mongo getSimilar.js apples
And then in the script file, select the argument passed.
var arg = $1; print(arg);
javascript scripting mongodb
Brig Apr 11 2018-12-12T00: 00Z
source share