In the terminal I can see all the data I want to use but In the console (browser) I get the error that “database” is not defined.
I put here all the code I’ve wrote so far in each folder:
server folder:
var database = new MongoInternals.RemoteCollectionDriver( "<url>");
c = new Mongo.Collection("r", {
_driver: database
});
Meteor.publish('r', function() {
return c.find();
});
Template:
<template name="testTableddp">
<div>Conexion Test!</div>
{{#each data}}
<div>
<td>{{DataIwantToFind}}</td>
</div> {{/each}}
`
Router:
this.route('testTableddp', {
path: '/testTableddp',
layoutTemplate: 'testTableddp',
waitOn: function() {
return database.subscribe('r');
},
data: function() {
return {
'data': c.find({
"post_date": "2014-10-07 09:26:50"
})
};
}
});