I think I faced a similar problem a while back.
To resolve this, I create a temporary dictionary and set the key, value
like this:

var res={};
res[key] = value;
return [res];

Using something like var res={key:value}; also did not work, as far as I
remember.

Maybe others could shed some light on this.

--
Yousuf

On Wed, Jul 11, 2012 at 4:12 PM, Yousuf Fauzan <yousuffau...@gmail.com>wrote:

> What the reduce function that you are using?
>
> On Wed, Jul 11, 2012 at 4:02 PM, Venki Yedidha <
> venkatesh.yedi...@gmail.com> wrote:
>
>> Hi All,
>>
>>    I am stuck with Riak group by using json object..
>>
>>   when I am returning some thing like this:
>>
>>   return [value.key] or return[value.bucket]..
>>
>>   It is going to reduce function and giving output..
>>
>>
>>  But, when I try something like:
>>
>>
>>   return [{value.key : data}]
>>
>>  It is throwing error like below:
>>  SyntaxError: missing : after property id.
>>
>> when I try:
>>  return[{\"venkatesh\": data}]
>>
>>  I am getting response..
>>
>> I notice that there is some problem with value.key where as I can access
>> it anywhere in the program freely except in return format.
>>
>> Please help me 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
>>
>>
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to