Connect to existing MongoDB in Windows


#1

I created a Mongodb instance that I want to use for logging. (http://samlea.ch/dev/log4mongo-net/)

So now I have a ‘logs’ db running on the standard Mongo port 27017.

How do I get Meteor to connect and read from it? I’ve read some things stating there are limitations to using existing DBs, but I am not going to update, only read. (Forget the reference)

I tried using MONGO_URL=mongodb://localhost:27017/log4net meteor, but that didn’t work and got an error 'MONGO_URL' is not recognized as an internal or external command, operable program or batch file.

It looks like Meteor defaults the db in to the project directory, versus the DB I have is in a different folder. I’m also concerned I created the DB with a 64bit version and Meteor uses a 32bit?

Thanks for helping a noob.


#2

I am quite not sure how to do this windows component prompt. What you have tried how to do in bash.

Try googling how to expose env vars in windows command prompt.


#3

It turns out you need to restart Windows since it is running as a Local Service, the Env Variables do not get picked up until Windows restarts.


#4

@scojomodena: I am having the same issue at the moment. Trying to connect to a mongo test instance that i have on the cloud via the windows mongo shell. This tends to work out pretty smoothy in linux/mac OS when i do

MONGO_URL=mongodb://localhost:27017/log4net meteor

However, windows is not to co-operative when i run that command. Could you please give me a bit more insight as to how i would go about solving this issue?

Thanks


#5

Sorry, just saw this now. Did you get it resolved? Do you know how to set env variables in Windows?


#6

place export in front of the command