Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB shell run() function

Tags:

mongodb

run("/test.js")

in mongo shell. i always get error

run("/test.js") shell: started program /test.js sh2516| Unable to start program /test.js errno:13 Permission denied 255

for test i add 777 permission on this file i doesn't have any passwords on DB

test.js is empty

What am I doing wrong?

like image 535
Falcon Avatar asked Jan 11 '11 15:01

Falcon


People also ask

What is Run command in MongoDB?

Definition. db.runCommand(command) Provides a helper to run specified database commands. This is the preferred method to issue database commands, as it provides a consistent interface between the shell and drivers. Parameter.

What runs MongoDB shell?

mongorc. js File. When starting, mongo checks the user's HOME directory for a JavaScript file named .


1 Answers

try using load() rather than run(). load is for javascript while run is for system binaries.

like image 100
mstearn Avatar answered Oct 27 '22 01:10

mstearn