As a newcomer to Meteor, I am trying to access data from my local MongoDB database. In my project structure, the client folder contains a client.js file with the following code:
Meteor.subscribe('Signal');
console.log(Data.find().fetch());
In the server directory, there is a main.js file that includes the following code:
console.log(Data.find());
Meteor.publish('Signal', function() {
return Data.find().fetch();
});
While the server's console.log displays the result in the terminal, nothing appears in the client's Chrome console.
Additionally, within the lib/ directory, I have a collections.js file that defines the 'Data' collection as follows:
Data = new Mongo.Collection('data');
Upon checking the MongoDB database through the shell, I can see that the 'data' collection exists with the required data. Despite this, I am unable to retrieve the data in my Meteor application. What could be causing this issue?