1

I know you can create a Javascript file that the MongoDB shell will execute upon startup. But I'm hoping for something more "lightweight" than that. I am using a Linux program that has a scripting language built in it. But the scripting language can not do operations like opening sockets, etc. It does have a "system" command to shell out to a Linux process. I would like to be able to push data into MongoDB via a Bash shell script and immediately return to the Linux process that spawned it, and quickly if I can since I intend to do this a few times a second (but not much more than that). It seems to me that shelling to the MongoDB shell and then have it execute a startup Javascript file would be a heavyweight operation relatively speaking? Is there a command line that I could craft from a bash script that would do a few quick MongoDB database operations and the exit? I have the MongoDB daemon running at all times on the default port.

  • this would be trivial in let's say python... – Alex P. Jun 16 '13 at 4:09
  • As well in perl. – bsd Jun 16 '13 at 10:28
  • 1
    calling system and a shell to run perl, python or another app is also relatively heavyweight – bsd Jun 16 '13 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.