FAQ
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

On Tue, Jul 24, 2012 at 4:35 AM, Gergely Németh wrote:
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedJul 24, '12 at 1:38p
activeJul 25, '12 at 4:19p
posts3
users2
websitenodejs.org
irc#node.js

2 users in discussion

Gergely Németh: 2 posts Thomas Blobaum: 1 post

People

Translate

site design / logo © 2022 Grokbase