Simple Todos tutorial gives no Tasks from MongoDB

Hi, I was following the tutorial Simple Todos and got stuck at the 3rd step:

I just get blank Todo list no matter how many items I populate into MongoDB using:

meteor mongo

I tried both on Mac & Linux and get the same issue. No error, no crash, just Tasks collection is empty. All I did is just copying from the tutorial:


import { Mongo } from 'meteor/mongo';
export const Tasks = new Mongo.Collection('tasks');


    tasks() {
        // Show newest tasks at the top
        return Tasks.find({}, { sort: { createdAt: -1 } });

Installation details:

Meteor has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.

Any help is appreciated. Thank you.

need a bit more info…can you check in your console if task items exist?

Sorry which console?

When I ran meteor mongo and db.tasks.find(), I get results:

{ "_id" : ObjectId("571ead1842d501eb9ed99f58"), "text" : "Feed the pets", "createdAt" : ISODate("2016-04-25T23:49:44.541Z") }

So I didn’t read the tutorial very carefully :slight_smile: I had to import tasks.js into server/main.js :slight_smile: Thanks for helping.

1 Like

ah i thought it had something to with import…trust me wont be the last time you forget to import something :smiley:

1 Like

Hey, I got very same problem, I cannot see data from db on my webpage. After reading this branch I doubled checked my imports and I got everything imported as mentioned in the tutorial. I am sure that I inserted data to database because I can see objects in my database using cmd.
I just started to learn how to use meteor and I get immediately stuck.
I appreciate any help,

same problem goes here!! any one please help

I fixed up my problem by writing code on server/main.js file like this i hope this works for you too

import { Meteor } from ‘meteor/meteor’;
import { Mongo} from ‘meteor/mongo’;

Meteor.startup(() => {
// code to run on server at startup
Tasks = new Mongo.Collection(‘tasks’);


Thank you very much for fast reply. It fixed my problem too.

This confused me too, but see -

The tasks.js import goes in server/main.js and not client/main.js


haha… same problem. note the difference between server/main.js and client/main.js


Maybe the tutorial styles must be updated a bit to make it more clear the file name/path is different. I spend some time searching what is the problem with my MongoDB. It’s a bit frustrating to fail a tutorial on the second step.

Hello World - Jan 2019 :slight_smile: