HTTP JSON in method and session.set with "JSON.parse(result.content)"


I made a method “myMeteorMethod” on server witch gives back data in JSON file

On the client side a call method "myMeteorMethod"and connect it to “myMethodResult” session and thanks to “JSON.parse(result.content)” i take first value “[0].node.title” from “nodes” table

How to take all values from “nodes” table.

if (Meteor.isClient) {'myMeteorMethod', function(error, result){
  Session.set('myMethodResult', JSON.parse(result.content).nodes[0].node.title);

    counter: function(){
      return Session.get('myMethodResult'); //

if (Meteor.isServer) {
  'myMeteorMethod': function() {
    var result;
    result = HTTP.get('');
    return result;

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


  <h1>Welcome to Meteor!</h1>

  {{> hello}}

<template name="hello">
  <button>Click Me</button>
  <p>You've pressed the button {{counter}} times.</p>




Session.set('myMethodResult', JSON.parse(result.content){return it.node.title;}));

In case you get something like “map is not a function” run meteor add underscore to add the underscore package and then use this code:

Session.set('myMethodResult',, function(it){return it.node.title;}));

Suggestion: You (seem to) lack some basic JavaScript knowledge, like array iteration. You might benefit immensely from getting the basics down through some course like this one for example:


thank you for your help