Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6853593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:31:50+00:00 2026-05-27T01:31:50+00:00

New to Mongo, just experimenting w the shell on a Windows XP machine running

  • 0

New to Mongo, just experimenting w the shell on a Windows XP machine running Mongo 2.0.1.

At the “>” mongo.exe cmd prompt, what do I enter in order to read cmds from another file called TEST.js ? I put a TEST.js file every place I could think of, and typed things like “>./mongo TEST.js”, “>.mongo full-pathname.js”, “>TEST.js”, etc.

Is there a way to do this ?

(Why?: I loaded a bunch of data w mongoimport & thought I could try a quick-and-dirty mapreduce from the > shell prompt prior to setting up via a ruby or python driver & doing it the right way. The map,reduce & finalize funcs are sitting in a *.js file, and I need those function defs imported before I can run the mapreduce method on my data collection.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:31:51+00:00Added an answer on May 27, 2026 at 1:31 am

    From the Windows XP command prompt, you can run the mongo shell (mongo.exe in Windows) with the “–shell” option followed by your filespec to start the mongo shell, load your file and then remain in the mongo shell. If your file defines “map” and “reduce” functions, those will be available to you at the mongo shell’s prompt.

    For example, “mongo --shell TEST.js” .

    Alternatively, you can start the mongo shell and then issue a “load” command to load your JavaScript file. The command ‘load(“TEST.js”)’ should do it for you.

    If these are functions you will want every time you start the mongo shell, you can put the JavaScript into a file named “.mongorc.js” (note the initial period) in your “user” directory, for example “C:\Documents and Settings\YourName\.mongorc.js” on Windows XP when logged in as YourName. The .mongorc.js feature was introduced in version 1.9, so your version has it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just installed the new MonoDevelop Windows beta, but when trying to create a
I just import my Mysql database (size 2,8 Mio) in my new Mongo database
I'm running this code: $db = new Mongo(mongodb://user:pw@flame.mongohq.com:27081/dbname); $collection = $db->foobar; $collection->insert($content); I'm trying
I'm new to Mono and just started recently. Is mono program are compiled from
I wrote these lines in My Application start event: var mongo = new Mongo();
I'm completely new to Mongo and RoR, coming from a PHP background. I was
I'm a .NET web developer and just bought a new Mac. I'm interested in
Here's the code I'm running: var wc = new WebClient (); var test1 =
I have just downloaded the most recent official 10gen mongo c# driver (1.1.0.4184) and
I have just installed Mono 2.10.1_3, MonoDevelop 2.4.2, and MonoTouch 4.0.3. In the order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.