You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ReQL proposal: make match polymorphic on streams #2026
Currently our rule is that functions which take objects are polymorphic on streams of objects. We could extend this rule to apply to function which take strings, too, but I'm not 100% sure that's a good idea.
As an aside, is there a reason why we've settled on this word counting thing as our canonical mapreduce example? It's:
Complicated (try explaining even the second query to people).
Awkward (this is the third time someone has proposed changing ReQL's semantics just to support it).
Not a normal use-case.
Why not do something simple like:
r.table('games').group('user').avg('score')
That shows off the feature, and is a much more common type of query.
I see what you mean. Let's leave this be for the moment, I think we should deal with #2024 first. Also, I don't think #2024 is about the word frequency example at all. I think that's what we always want (and I think we might be speaking past each other about what it actually means :))
match returns an object, and the str attribute is the string that was matched.
I guess @coffeemug just wanted to remove words with accents and non usual characters.
Okay, there exists some documentation somewhere that says it returns an array? That I read while in a delirious state last night. (And what is "'str'" supposed to mean, is that some sort of abbreviation for stromboli?)
Bumping to backlog; I don't want to start considering exceptions to our "only object operations are polymorphic on arrays" rule this close to the release.
Activity
coffeemug commentedon Feb 26, 2014
Also, I realize I'm really breaking the rules here by asking to discuss this for 1.12. I just think that making this example amazing is worth it.
mlucy commentedon Feb 26, 2014
Currently our rule is that functions which take objects are polymorphic on streams of objects. We could extend this rule to apply to function which take strings, too, but I'm not 100% sure that's a good idea.
As an aside, is there a reason why we've settled on this word counting thing as our canonical mapreduce example? It's:
Why not do something simple like:
That shows off the feature, and is a much more common type of query.
mlucy commentedon Feb 26, 2014
To clarify, these are the three:
The more I think about it, the more this seems bad. This example is basically arbitrary.
coffeemug commentedon Feb 26, 2014
I see what you mean. Let's leave this be for the moment, I think we should deal with #2024 first. Also, I don't think #2024 is about the word frequency example at all. I think that's what we always want (and I think we might be speaking past each other about what it actually means :))
coffeemug commentedon Feb 27, 2014
Moving to polish for now. Let's discuss this after we address the rest of recent GMR issues.
srh commentedon Mar 5, 2014
This code example makes no sense. What does
.match('[a-zA-Z]+')('str')do?.match(...)returns an array, generally, so what does('str')mean?neumino commentedon Mar 5, 2014
matchreturns an object, and thestrattribute is the string that was matched.I guess @coffeemug just wanted to remove words with accents and non usual characters.
srh commentedon Mar 5, 2014
Okay, there exists some documentation somewhere that says it returns an array? That I read while in a delirious state last night. (And what is "'str'" supposed to mean, is that some sort of abbreviation for stromboli?)
neumino commentedon Mar 5, 2014
The docs for
matchare wrong -- rethinkdb/docs#179mlucy commentedon Mar 13, 2014
@coffeemug -- how are you feeling about this now? I'd be happy to bump this to backlog or drop it entirely.
coffeemug commentedon Mar 14, 2014
I've lost my zeal for this issue. Dispose of it as you see fit.
mlucy commentedon Mar 17, 2014
Bumping to backlog; I don't want to start considering exceptions to our "only object operations are polymorphic on arrays" rule this close to the release.
coffeemug commentedon Jun 23, 2014
Closing in favor of #2578.