glasses
glasses

Reputation: 763

Meteor.js MongoDB access?

I am new to Mongo and Meteor.

I have installed Meteor on Mac OSX 10.8, and I have created a new Meteor app using a collection called 'Fillup'.

I am going through some tutorials about Mongo, and I am trying to learn the shell commands, but none of them are working.

I want to use Mongo command line to view and manipulate the collection I have going in my Meteor app.

I installed Mongo seperately after Meteor, and I think Meteor might me using a different 'copy' of Mongo, because now when I try 'mongo' I get :

$ mongo
MongoDB shell version: 2.4.5
connecting to: test
Sun Jul 28 14:25:33.055 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
exception: connect failed

Whether Meteor is running or not, and Meteor works fine.

Upvotes: 4

Views: 2716

Answers (2)

imslavko
imslavko

Reputation: 6676

Meteor is using different binaries of Mongo to keep the compatible version.

If you want to test your Mongo shell commands or just play with it on the same version as Meteor, create a Meteor app and keep it running:

meteor create testapp
cd testapp
meteor

And in different shell (or tab) run

meteor mongo

The reason why it didn’t work in your case: you didn’t start the MongoDB server command mongod. But when you run your Mongo app locally, it will run mongod with the correct set of flags and separate database file.

Upvotes: 13

Peter Long Nguyen
Peter Long Nguyen

Reputation: 71

Try running mongod first and then mongo.

To start MongoDB using all defaults, issue the following command at the system shell:

mongod

This is for vanilla MongoDB though, you might be using a Meteor-specific flavor like someone else mentioned.

http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/

Upvotes: 2

Related Questions