Facing problem with retreving data from mongodb

Hi there, i facing problem with data retriving from mongodb my data from mongo colletions is not working
what ever the app maybe the data is not retriving can any body help

Please post code examples of what you’re trying and what isn’t working.


import { Template } from ‘meteor/templating’;
import { ReactiveVar } from ‘meteor/reactive-var’;
import {Mongo} from ‘meteor/mongo’;

import ‘./main.html’;

Resolutions = new Mongo.Collection(“resolutions”);

resolutions : function(){
return Resolutions.find();

simple-todo app

body.js Code:-

import { Template } from ‘meteor/templating’;

import ‘./body.html’;

import ‘…/api/tasks.js’;

tasks: function() {
return Tasks.find({},{sort : { createdAt : -1 }});

‘submit .new-task’(event){
// Prevent default browser form submit

// Get value from form element
const target = event.target;
const text = target.text.value;

// Insert a task into the collection
createdAt: new Date(), // current time

// Clear form
target.text.value = ‘’;

I just fixed up my problem by writting up the code of data base in

server/main.js code :smile:

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

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

thanks for your help guys :smiley: