With meteor 1.3 i am not able to fetch data with database


i am new to meteor, as i followed your document but i am on the collection page its not working as per the suggested steps in the guide. I am using the new version 1.3 and its frustrating if the guide steps not working so where should i look up for how to work with meteor. The data is not fetching from the database shows nothing it gets inserted but not pulling back as per the steps.


Dropdown you code pls


Inside client folder-


I have removed starting bracket as its rendering html
Inside client folder-

import ‘…/imports/ui/body.js’;
import ‘…/imports/api/tasks.js’;

Inside imports folder there are two folders ui and api

tasks.js inside api folder

import { Mongo } from ‘meteor/mongo’;

export const Tasks = new Mongo.Collection(‘tasks’);

body.html inside ui folder

div class=“container”>
h1>Todo List

    {{#each tasks}}
        {{> task}}


  • {{text}}
  • body.js inside ui folder

    import { Template } from ‘meteor/templating’;

    import { Tasks } from ‘…/api/tasks.js’;

    import ‘./body.html’;

    tasks() {
    return Tasks.find({});

    then i entered the data from cmd by doing meteor mongo and then
    db.tasks.insert({ text: “Hello world!”, createdAt: new Date() });

    Data shows in mongo shef when i connect it but i am not able to fetch this data…


    Did you remove autopublish package ?


    no i have not removed this packaage


    I have the same issue. My data was successfully inserted, but it is not fetching from the database. I’ve also followed the steps in getting started guide for simple-todos app.


    is your sever file being imported correctly? thats the problem most of the time i see these issues


    Try to insert this line in server/main.js

    import {Tasks} from '../imports/api/tasks.js'


    nothing changed its same…


    how can i check , whether my server file is being imported or not?


    easiest way is to use a console.log statement in your server file and see if it gets executed in your cmd


    looks like in the tutorial the server file is outside of the imports folder so it should be imported automatically


    import { Meteor } from ‘meteor/meteor’;


    Meteor.startup(() => {
    // code to run on server at startup

    i did this but console is blank i am very new to meteor so do not have much idea…


    are you on this step?

    can you post your file structure


    yes i am following same tutorial…



    so you are saying the data is in the mongo…can you check if it is on the client.
    Type Task.find().fetch() in your chrome console or w/e browser u are using


    i am using google chrome

    Task is not defined

    this is the error what i am receiving on writing this


    sorry, Tasks not Task…its the name of your collection which u defined


    export const Tasks = new Mongo.Collection(‘tasks’);

    this is what i have written in tasks.js with this ling when i type on console Tasks.find().fetch()

    this error comes VM1596:1 Uncaught ReferenceError: Tasks is not defined(…)

    but when i write only Tasks = new Mongo.Collection(‘tasks’); this is tasks.js then in the console it is showing object and data inside that but not in the browser


    can you remove this import link form client/main.js

    import '../imports/api/tasks.js';