New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contain for array #211
Comments
One way to do this is as follows: r.expr([286108290734252030]).map {|id| r.table(table).get(id)}.filter {|t| t[:entities][:urls].filter{|u| u.contains('expanded_url')}.count.gt(0)}.run |
So there are a few questions here (that I can think of):
|
This is the best I could do with @charl's example: table.filter(function(row) {
return row.contains("entities").and(
row('entities').contains('urls').and(
row('entities')('urls').map(function(url) {
url.contains('expanded_url').and(
function_of_expanded_url(url('expanded_url'))
)
}).reduce(false, function(acc, val) {
return acc.or(val)
})
)
)
}).run() There are two things I can think of to make this simpler. The first would be to implement a table.filter(function(row) {
return r.catch(
row('entities')('urls').any(function(url) {
r.catch(function_of_expanded_url(url('expanded_url')), false)
})
, false)
}).run() |
|
We don't need |
I was thinking about using r.catch with r.error. |
Or perhaps we don't need the changes proposed in #183 because we have |
From an ease-of-explanation perspective, |
Here is how I'd like to write the original query:
I'd be OK with using something else instead of ('*') to indicate that the match should be done for each element of an array. Gave it a bit more thought and instead of Example:
|
So
which we could have sugar for. So you'd actually get to say:
which would return I don't think there's any reason users will ever have to see the word
I'm a bit dubious about having a
Seems like a potential way to update the keys in which |
BTW, if we had to expose it to the user, we wouldn't expose the word |
Ahh, I see. I kept thinking, what's the point, we already have errors that propagate like this. The distinction is that bottom is a value propagated up the function composition chain rather than an exception that jumps up the call stack to an error handler. While the behavior is similar it is actually subtly different. While we don't have Rather than saying that |
This may or may not be a dup of #198. I'll consider this shortly. |
I feel our current |
Cleanup officer to the rescue. (I think we might still be able to do more, but this issue is obsolete at this point -- let's open a new one if this comes up) |
It would have solve this problem: https://gist.github.com/4500622
I think we talked about that once with @coffeemug @mlucy and @wmrowan but I couldn't find an issue on github.
Tagging as post protobuf improvements
The text was updated successfully, but these errors were encountered: