Simple ToDos- Blaze - Step 3


#1

So I am currently trying to Insert tasks from the server-side database console.
When i type in meteor mongo, this is what i get- any insight into what I may be doing wrong?

Last login: Wed Jun 22 18:17:27 on ttys001
Gayatris-MBP:simple-todos Gayatriom$ meteor mongo
mongo: Meteor isn’t running a local MongoDB server.

This command only works while Meteor is running your application locally. Start your application
first with ‘meteor’ and then run this command in a new terminal. This error will also occur if you
asked Meteor to use a different MongoDB server with $MONGO_URL when you ran your application.

If you’re trying to connect to the database of an app you deployed with ‘meteor deploy’, specify
your site’s name as an argument to this command.
Gayatris-MBP:simple-todos Gayatriom$ meteor
Can’t listen on port 3000. Perhaps another Meteor is running?

Running two copies of Meteor in the same application directory
will not work. If something else is using port 3000, you can
specify an alternative port with --port .
Gayatris-MBP:simple-todos Gayatriom$


#2

I think the error message explains the issue well. First make sure your app is running and then open another terminal and enter meteor mongo


#3

Hmm. I did that and this is what I’m getting:
Do I need to reopen simple-todos ?
Even though it’s open in another window?

Last login: Thu Jun 23 09:51:39 on ttys003
Gayatris-MBP:~ Gayatriom$ meteor mongo
mongo: You’re not in a Meteor project directory.

To create a new Meteor project:
meteor create
For example:
meteor create myapp

For more help, see ‘meteor --help’.
Gayatris-MBP:~ Gayatriom$ db.tasks.insert({ text: “Hello world!”, createdAt: new Date() });
-bash: !",: event not found
Gayatris-MBP:~ Gayatriom$
Gayatris-MBP:~ Gayatriom$


#4

as the error says, make sure you are in your meteor app directory before running meteor mongo


#5

How do I get into a project directory. If they ask me to open a new window then I am not in the simple todos app anymore. How do I access it again.


#6

Sorry for the total newbie questions!


#7

ok so i closed out of terminal completely.
Then I opened it back up.
Simple Todos is running.
See here: Last login: Thu Jun 23 12:38:07 on ttys005
Gayatris-MacBook-Pro:~ Gayatriom$ sudo meteor
run: You’re not in a Meteor project directory.

To create a new Meteor project:
meteor create
For example:
meteor create myapp

For more help, see ‘meteor --help’.
Gayatris-MacBook-Pro:~ Gayatriom$ cd meteor simple-todos
-bash: cd: meteor: No such file or directory
Gayatris-MacBook-Pro:~ Gayatriom$ cd simple-todos
Gayatris-MacBook-Pro:simple-todos Gayatriom$ meteor run
[[[[[ ~/simple-todos ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Meteor 1.3.4 is available. Update this project with ‘meteor update’.
=> Started your app.

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

THEN I opened up a new window and typed in the below:
Gayatris-MacBook-Pro:~ Gayatriom$ cd simple-todos
Gayatris-MacBook-Pro:simple-todos Gayatriom$ meteor mongo
mongo: Meteor isn’t running a local MongoDB server.

This command only works while Meteor is running your application locally. Start
your application first with ‘meteor’ and then run this command in a new
terminal. This error will also occur if you asked Meteor to use a different
MongoDB server with $MONGO_URL when you ran your application.

If you’re trying to connect to the database of an app you deployed with
’meteor deploy’, specify your site’s name as an argument to this command.
Gayatris-MacBook-Pro:simple-todos Gayatriom$

It doesn’t make sense why it’s not loading!


#8

Hey Erick,
Thanks so much for your help.

ok so i closed out of terminal completely.
Then I opened it back up.
Simple Todos is running.
See here: Last login: Thu Jun 23 12:38:07 on ttys005
Gayatris-MacBook-Pro:~ Gayatriom$ sudo meteor
run: You’re not in a Meteor project directory.

To create a new Meteor project:
meteor create
For example:
meteor create myapp

For more help, see ‘meteor --help’.
Gayatris-MacBook-Pro:~ Gayatriom$ cd meteor simple-todos
-bash: cd: meteor: No such file or directory
Gayatris-MacBook-Pro:~ Gayatriom$ cd simple-todos
Gayatris-MacBook-Pro:simple-todos Gayatriom$ meteor run
[[[[[ ~/simple-todos ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Meteor 1.3.4 is available. Update this project with ‘meteor update’.
=> Started your app.

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

THEN I opened up a new window and typed in the below:
Gayatris-MacBook-Pro:~ Gayatriom$ cd simple-todos
Gayatris-MacBook-Pro:simple-todos Gayatriom$ meteor mongo
mongo: Meteor isn’t running a local MongoDB server.

This command only works while Meteor is running your application locally. Start
your application first with ‘meteor’ and then run this command in a new
terminal. This error will also occur if you asked Meteor to use a different
MongoDB server with $MONGO_URL when you ran your application.

If you’re trying to connect to the database of an app you deployed with
’meteor deploy’, specify your site’s name as an argument to this command.
Gayatris-MacBook-Pro:simple-todos Gayatriom$

It doesn’t make sense why it’s not loading!


#9

No idea how - but finally made it work!