Thanks! hopefully this is what i was looking for. 2012. július 24., kedd 16:28:26 UTC+2 időpontban Thomas a következőt írta: > > if i understand what you want to do correctly, you could possibly use > redis-stream like so > > https://gist.github.com/3170212 > > --- > > var Redis = require('redis-stream') > , client = new Redis('localhost', 6379, 0) > , stream = client.stream() > > // this will get an intersection of all the elements in > // `set1`, `set2` & `set3` and then it will use each of the members > // in the resulting intersection as a key in a `sinter` with `subset1` > // and each of those resulting sets will be piped to stdout > // this will not use pipelining and will call `sinter subset1 member` once > // for every member of the original intersection > > stream > .pipe(client.stream('sinter', 'subset1')) > .pipe(process.stdout) > > // if you want `sinter` here to function as `sinterstore` > // while still returning the resulting set, then you can > // also save this to another set like `sinterstore` does > > stream.pipe(client.stream('sadd', 'my-sinterstore-result-store')) > > // kick it off > stream.redis.write(Redis.parse([ 'sinter', 'set1', 'set2', 'set3' ])) > > --- > > Thomas Blobaum > https://github.com/tblobaum > > > > > My problem is that i have a SINTERSTORE with many elements, and somehow > i > > want to make a "foreach" on each of the elements to use them in a SINTER > > operation ( one a a time ). > > > > To be more specific, here is a little code snippet : > > > > client.sort(query, function (err, reps)) > > > > > > { > > > > > > reps.forEach(function (reply, i){ > > > > > > client.sinter(){ > > > > > > //dosomething > > > > > > } > > > > > > } > > > > > > } > > > > > > So somehow it would be nice if I could redeem the foor loop. > > > > Do you have any suggestions how can i do that ? > > > > -- > > Job Board: http://jobs.nodejs.org/ > > Posting guidelines: > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/nodejs?hl=en?hl=en >
-- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
