Hi All,

       I have a map function which takes inputs for all countries:
       my bucket format is
[["20120822","IN"],["20120822","IS"],["20120822","CN"],["20120822","US"],["20120822","AS"],["20120822","JP"]]

      my json format is :

 $m=    ' {
    "IN": {
        "Internetusers": "12816",
        "population": "193161"
    },
    "IS": {
        "Internetusers": "26907",
        "population": "571890"
    },
    "CN": {
        "Internetusers": "800",
        "population": "1384"
    },
    "US": {
        "Internetusers": "12487",
        "population": "105916"
    },
    "AS": {
        "Internetusers": "12487",
        "population": "105916"
    },
    "JP": {
        "Internetusers": "12487",
        "population": "105916"
    }
}';
$m = addslashes($m); //this just adds \ infront of " to escape double
quotes.



Now I am accessing this inside a map function written in javascript(my
server side script is php),like:
   var k = '.$m.';
   when I am trying to access k[value.key], it throws an error saying
k[value.key][\"Internetusers\"] is undefined..
   On the other hand, giving a static value works fine for me..
  like k[\"JP\"][\"Internetusers\"] works fine....

I thought k[value.key] should work fine because my bucket keys and my json
keys are same...

I tried all these types.

k[value.key],k[\"'.value.key.'\"],k[\"'+value.key.+\"] etc

Please help on the above,

Thanks,
Venkatesh.Y
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to