Well there is a small problem with my code somewhere, I have been working for about 2 days trying to find this bug. Or maybe I am just missing some concept.
Here is what each node would have inserted into its Nodes collection.
`var sampleInput_4 ={
name: "Tulsa Node",
longitude: -95.982,
latitude: 36.137,
humidity: 78,
temp: 80,
dew: 20,
pressure: 32,
speed: 12,
direction: 60
};`
Here is the html code that is used to cycle through all the Nodes names.
`{{#each nodes}}
<li>
<a href="{{pathFor 'NodePage'}}">
{{this}}
</a>
</li>
{{/each}}`
Now the publisher from the server side is just standard sending the whole collection… Here is the js code
`Template.sidebar.helpers({
nodes: function(){
var wow = _.uniq(_.pluck(Nodes.find().fetch(),"name"));
return wow;
}
});
Template.sidebar.onCreated(function () {
this.subscribe('nodes');
});
`
Now the router.
`Router.route('/:name', {
name: 'NodePage',
data: function(){
console.log(Nodes.find().fetch());
return Nodes.find({name: this.params.name});
},
});`
If I have
`return Nodes.find();`
in the js file instead of my code it returns all the objects and makes a clickable sidebar for that object and even routes to the templates name. But this makes one for every collection item. I just want the unique names. However I have looked around and have seen others with this problem and have not been able to sort out my own code for this. Also this collection has a schema.
Is there something I am missing?