Thanks , i used map and it work as i wanted.

On Fri, May 29, 2015 at 4:07 AM, slah <slach...@gmail.com> wrote:

> Hello,
> one option is to use the filter function,
>
> var ar = [{"content": "content", "id":
> "b0e9eddc-ef07-4189-a45c-b15ab5986ad8",
> "parent": "default", "stamp": 1432829154.657, "type": "message_vote",
> "user": {"user_name": "v3ss0n", "userid":
> "31fa17e5-5b65-4526-ab66-d4afcf7d1750"},
>  "vcount": -1}];
>
> var result = ar.filter(function(obj ) {
>   return obj.id == "b0e9eddc-ef07-4189-a45c-b15ab5986ad8";
> });
>
> You may also try a simple for loop.
>
> Regards,
>
>
>
>
>
>
> Phyo Arkar wrote
> > i have data like this, for qooxdoo list:
> >
> > [{"content": "content", "id": "b0e9eddc-ef07-4189-a45c-b15ab5986ad8",
> > "parent": "default", "stamp": 1432829154.657, "type": "message_vote",
> > "user": {"user_name": "v3ss0n", "userid":
> > "31fa17e5-5b65-4526-ab66-d4afcf7d1750"},
> >  "vcount": -1}]
> >
> > There will be a lot of items , 100k +
> >
> > What i want to do is update value of item inside by searching "id":
> > "b0e9eddc-ef07-4189-a45c-b15ab5986ad8" ,
> > .
> > Is there built in array methods to do it efficiently?
> > What would be most efficient way to do ?
> > Can i bind object instead of array of object so i can select index by
> > [‘b0e9eddc-ef07-4189-a45c-b15ab5986ad8’] ?
> >
> > Thanks.
> > ​
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > qooxdoo-devel mailing list
>
> > qooxdoo-devel@.sourceforge
>
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
>
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Updating-data-of-object-inside-array-tp7587196p7587198.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to