How is Meteor - Mongo connection configured?

I’m a rails guy trying to learn Meteor.

About 5 minutes into the Meteor tutorial I find that my Meteor app cannot talk to Mongodb.

I see evidence that recent commits to the Meteor framework have broken the meteor shell command so it cannot connect to Mongodb.

So it looks like I need to work around this bug and probably others.

To do that I need answers to this question:

How is Meteor - Mongo connection configured?

Hey there!

I tried the current (official) version and it seems to work.

➜  /tmp  meteor create mongotest
mongotest: created.                           

To run your new app:                          
  cd mongotest                                
  meteor                                      
➜  /tmp  cd mongotest 
➜  mongotest  meteor update
This project is already at Meteor 1.1.0.2, the latest release.
Your packages are at their latest compatible versions.
➜  mongotest  meteor
[[[[[ /private/tmp/mongotest ]]]]]            

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/

May you post your error messages?

You can configure the mongodb connection by shell env. variables just like you would in production.
Here is an example of how to do that: http://stackoverflow.com/questions/10588038/how-to-use-the-existing-mongodb-in-a-meteor-project

I hope this helps.

M,

you dont understand the issues I face but you did respond to my post so I offer you praise for taking the time.

Issue 1: The shell command ‘meteor mongo’ is broken.

Issue 2: ‘meteor mongo’ is broken, so that breaks the demo in this URL: https://www.meteor.com/try/3

I poked at these issues on my own and found some work-arounds:

work-around1:

dan@u88:~ $ 
dan@u88:~ $ 
dan@u88:~ $ cd bin
dan@u88:~/bin $ 
dan@u88:~/bin $ find ~/.meteor -name mongo -type f -print
/home/dan/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongo
dan@u88:~/bin $ 
dan@u88:~/bin $ ln -s ~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongo .
dan@u88:~/bin $ 
dan@u88:~/bin $ 


dan@u88:~/bin $ 
dan@u88:~/bin $ ~/bin/mongo --port 3001
MongoDB shell version: 2.6.7
connecting to: 127.0.0.1:3001/test
meteor:PRIMARY> 
meteor:PRIMARY> 

work-around2:

dan@u88:~/bin $ 
dan@u88:~/bin $ ~/bin/mongo --port 3001
MongoDB shell version: 2.6.7
connecting to: 127.0.0.1:3001/test
meteor:PRIMARY> 
meteor:PRIMARY> help
snip...
meteor:PRIMARY> 
meteor:PRIMARY> show dbs
admin   (empty)
local   0.063GB
meteor  0.031GB
test    (empty)
meteor:PRIMARY> 
meteor:PRIMARY> 
meteor:PRIMARY> use meteor
switched to db meteor
meteor:PRIMARY> 
meteor:PRIMARY> db.tasks.insert({ text: "Hello world!", createdAt: new Date() });
WriteResult({ "nInserted" : 1 })
meteor:PRIMARY> 
meteor:PRIMARY> 

Although ‘meteor mongo’ is broken, I suspect that it issues this command: ‘use meteor’

I found that after I issue that command at the mongo CLI,
then data I enter into mongo,
becomes visible in my browser.

In response to your question about error messages…
I saw no error messages.
The behavior of the bug was a lack of data in my browser.

Hey there!

Ahh ok.

I would prefer work-around2. :smile:

Thanks for sharing!